efficient-shell 8.16.2 → 8.18.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 +89 -7
- package/dist/{Browser-AUE7SDAW.js → Browser-H5OJL6TK.js} +14 -14
- package/dist/Calculator-VHXRKH2M.js +29 -0
- package/dist/{CurrencyConverter-XK6SETYS.js → CurrencyConverter-5AIXDNF6.js} +8 -8
- package/dist/{Documents-GOOUHNMJ.js → Documents-352IGNWY.js} +19 -19
- package/dist/Files-ODENHLKQ.js +87 -0
- package/dist/{Notepad-MQJGT2B6.js → Notepad-DWPTCM2I.js} +10 -10
- package/dist/PdfViewer-456B27TB.js +1 -0
- package/dist/{PomodoroTimer-D37Y6TE7.js → PomodoroTimer-YWR6X3FT.js} +34 -34
- package/dist/{Preview-YSN6S5M6.js → Preview-LMUHIWNB.js} +46 -46
- package/dist/Sidebar-ZIHLBHKR.js +43 -0
- package/dist/{Spreadsheet-KRLDLSRZ.js → Spreadsheet-DAZUBPFY.js} +13 -13
- package/dist/{Stock-ZUTJX6S6.js → Stock-C2EQYFNA.js} +7 -7
- package/dist/{Weather-4GPPPHK5.js → Weather-EZU5A7JW.js} +19 -19
- package/dist/{WorldClock-TW36BP7G.js → WorldClock-SKUEYQXU.js} +6 -6
- package/dist/ai/index.js +15 -15
- package/dist/apps/index.js +1 -1
- package/dist/bin/media-host-check.js +1 -1
- package/dist/bin/ui-check.js +1 -1
- package/dist/brand.css +1 -1
- package/dist/charts/BoxPlotChart.js +1 -1
- package/dist/charts/CandlestickChart.js +1 -1
- package/dist/charts/CartesianPlot.js +1 -1
- package/dist/charts/ChartBrush.js +1 -1
- package/dist/charts/ChartFrame.js +1 -1
- package/dist/charts/ChartSkeleton.js +1 -1
- package/dist/charts/ChordChart.js +1 -1
- package/dist/charts/ColumnChart.js +1 -1
- package/dist/charts/FunnelChart.js +1 -1
- package/dist/charts/HeatmapChart.js +1 -1
- package/dist/charts/HistogramChart.js +1 -1
- package/dist/charts/Meter.js +1 -1
- package/dist/charts/PieChart.js +1 -1
- package/dist/charts/RadarChart.js +1 -1
- package/dist/charts/RadialBarChart.js +1 -1
- package/dist/charts/RangeChart.js +1 -1
- package/dist/charts/RankedBars.js +1 -1
- package/dist/charts/SankeyChart.js +1 -1
- package/dist/charts/ScatterChart.js +1 -1
- package/dist/charts/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-WAMBQNDN.js → chunk-2QYQDCJE.js} +14 -14
- package/dist/{chunk-T6L6HQI5.js → chunk-2RKTVTJJ.js} +1 -1
- package/dist/{chunk-42U4LJT7.js → chunk-2VFRVO3N.js} +26 -26
- package/dist/{chunk-3VCAQ72C.js → chunk-2YZ3ITNG.js} +2 -2
- package/dist/{chunk-CP6Q24MP.js → chunk-2ZIVFBJN.js} +8 -8
- package/dist/{chunk-LJSJFS2M.js → chunk-37DRDM4D.js} +12 -12
- package/dist/{chunk-2VLQECPC.js → chunk-3NU2B2WM.js} +9 -9
- package/dist/{chunk-QV2GME3Y.js → chunk-3XLDWJDG.js} +6 -6
- package/dist/{chunk-VJPJNCB4.js → chunk-42BBJJDP.js} +2 -1
- package/dist/{chunk-TWWJLFTD.js → chunk-4JCNWUVZ.js} +4 -4
- package/dist/{chunk-7UBV5MPQ.js → chunk-4NB3WHWK.js} +1 -1
- package/dist/{chunk-O6TKI4F5.js → chunk-4S724CEA.js} +1 -1
- package/dist/{chunk-S2ONNZVX.js → chunk-56CQPUIJ.js} +15 -15
- package/dist/{chunk-CASSD64W.js → chunk-5N6VSOZV.js} +5 -5
- package/dist/chunk-5QFPTDQF.js +1 -0
- package/dist/{chunk-UL4WB3VH.js → chunk-5WYCXSUM.js} +1 -1
- package/dist/{chunk-NIULZZAI.js → chunk-6EAVTBKE.js} +1 -1
- package/dist/{chunk-XF2NZVXW.js → chunk-6JLZMVVE.js} +6 -6
- package/dist/{chunk-RECXXFYW.js → chunk-6MN2JR25.js} +8 -8
- package/dist/{chunk-G2A4K36M.js → chunk-6OPAUSMV.js} +2 -2
- package/dist/{chunk-2M5JD52X.js → chunk-6YPZHG7O.js} +2 -2
- package/dist/{chunk-SDIGC5NU.js → chunk-73FD77RD.js} +1 -1
- package/dist/chunk-7F5FURAC.js +1 -0
- package/dist/{chunk-QP2S2K2Y.js → chunk-7GCBMTP2.js} +3 -3
- package/dist/{chunk-PRR2GXBV.js → chunk-7NOU275V.js} +2 -2
- package/dist/{chunk-IJMV4F2Q.js → chunk-A3MOA3T7.js} +1 -1
- package/dist/{chunk-OS57C5J7.js → chunk-A3R6DKQ5.js} +1 -1
- package/dist/{chunk-KLAZTKN2.js → chunk-AAYACT5T.js} +4 -4
- package/dist/{chunk-Y3XH4HJQ.js → chunk-ABD34D3N.js} +3 -3
- package/dist/chunk-AG3ALTVD.js +20 -0
- package/dist/chunk-AJOWAZ46.js +1 -0
- package/dist/{chunk-LI7D6SMK.js → chunk-APMBWBD7.js} +1 -1
- package/dist/{chunk-VCEARTZR.js → chunk-B6BE4WSP.js} +6 -6
- package/dist/chunk-BE4APEUI.js +2 -0
- package/dist/{chunk-OU3ITBK5.js → chunk-BG5BCF64.js} +6 -6
- package/dist/{chunk-ENSA3NAS.js → chunk-BJGD2ZWK.js} +1 -1
- package/dist/{chunk-O3WSAR62.js → chunk-BVDGHZ4H.js} +1 -1
- package/dist/{chunk-7KYFOYC7.js → chunk-CG4KTWP4.js} +5 -5
- package/dist/chunk-CGY5RNAF.js +3 -0
- package/dist/chunk-CKDFXYYY.js +8 -0
- package/dist/{chunk-XTPDXB4X.js → chunk-DBBUHXRT.js} +1 -1
- package/dist/{chunk-XKCEVZZB.js → chunk-DGTP6BGV.js} +1 -1
- package/dist/{chunk-CTB634WT.js → chunk-DQEST7MN.js} +1 -1
- package/dist/{chunk-QIEMOYTG.js → chunk-DTJQHW3Q.js} +1 -1
- package/dist/chunk-EA37JL6P.js +3 -0
- package/dist/{chunk-PSOHSTXL.js → chunk-EFUQ4KAH.js} +1 -1
- package/dist/{chunk-GATOVTJT.js → chunk-EJNFOBE3.js} +4 -4
- package/dist/{chunk-SWSN3HZX.js → chunk-EO2XHSIK.js} +2 -2
- package/dist/{chunk-HEJTHEXN.js → chunk-EOPPYQIT.js} +1 -1
- package/dist/{chunk-76YDO3KA.js → chunk-F2HM7SV4.js} +1 -1
- package/dist/{chunk-KSYNJTVA.js → chunk-FJUFQXDS.js} +20 -20
- package/dist/chunk-FNQJO3HZ.js +11 -0
- package/dist/chunk-FTQ5DH5U.js +8 -0
- package/dist/chunk-GTRUBA2R.js +1 -0
- package/dist/chunk-GVKFLNRP.js +12 -0
- package/dist/{chunk-YYUICWSB.js → chunk-GVYJYXVH.js} +7 -7
- package/dist/{chunk-KBHC4VLA.js → chunk-HAZLMRTT.js} +1 -1
- package/dist/{chunk-PDPBIDHF.js → chunk-HBBTB6RW.js} +1 -1
- package/dist/{chunk-2LKH6JM5.js → chunk-HIDOSOI4.js} +1 -1
- package/dist/{chunk-MH4EUGAB.js → chunk-HKAWQF7O.js} +7 -7
- package/dist/{chunk-HEM6NC23.js → chunk-HKTU536H.js} +1 -1
- package/dist/{chunk-4B7ZRWDA.js → chunk-HMA4ZSCS.js} +1 -1
- package/dist/{chunk-IH2DJOTW.js → chunk-HNFLUVVM.js} +10 -10
- package/dist/{chunk-ACZDVHDY.js → chunk-HQIUFRWO.js} +13 -13
- package/dist/{chunk-BMBQ3IX3.js → chunk-HQNR4JQG.js} +1 -1
- package/dist/{chunk-5BLAPU7W.js → chunk-I5T3A4KI.js} +1 -1
- package/dist/chunk-IC72MGON.js +1 -0
- package/dist/{chunk-WKSVUJZA.js → chunk-JBMGI5YX.js} +3 -3
- package/dist/{chunk-SNDYD76W.js → chunk-JLDGZFNY.js} +10 -10
- package/dist/chunk-JSOO4O5K.js +10 -0
- package/dist/chunk-JSVYN6D6.js +3 -0
- package/dist/{chunk-4AFNDOPF.js → chunk-K2DUF2AR.js} +1 -1
- package/dist/{chunk-RPAKTBQT.js → chunk-K5UPORAA.js} +1 -1
- package/dist/{chunk-HPQ56MKK.js → chunk-KH6GERFP.js} +1 -1
- package/dist/{chunk-ION2GBY3.js → chunk-KIYO4U4T.js} +12 -12
- package/dist/{chunk-YO52QEKT.js → chunk-KW4VUPJV.js} +9 -9
- package/dist/chunk-LACL4MAR.js +1 -0
- package/dist/{chunk-2DGTGJYJ.js → chunk-LAHK4WVH.js} +7 -7
- package/dist/{chunk-4EIGXW4U.js → chunk-LDHYCVMV.js} +1 -1
- package/dist/{chunk-EKFIRCNP.js → chunk-LJVLMM3Q.js} +8 -8
- package/dist/{chunk-RQARJHDB.js → chunk-LWGNNVDA.js} +1 -1
- package/dist/{chunk-2OTCFJCU.js → chunk-M7JJOCBU.js} +1 -1
- package/dist/{chunk-ZEDYXP2J.js → chunk-MKTO2FHK.js} +1 -1
- package/dist/chunk-MNQ6EPAR.js +9 -0
- package/dist/{chunk-VAACOJ2H.js → chunk-MPN267PR.js} +1 -1
- package/dist/{chunk-PK4ZY4GZ.js → chunk-NADUURUA.js} +3 -3
- package/dist/{chunk-EDEQRSJC.js → chunk-NQ46AZ3D.js} +1 -1
- package/dist/{chunk-EVKBV6IV.js → chunk-NU55QIUV.js} +1 -1
- package/dist/{chunk-5GHLKEJQ.js → chunk-O5PJELY7.js} +1 -1
- package/dist/chunk-OLFYNMTD.js +1 -0
- package/dist/{chunk-CD6PGAYP.js → chunk-P5ILG2DA.js} +1 -1
- package/dist/{chunk-OHHJF547.js → chunk-P5QRK7WD.js} +1 -1
- package/dist/{chunk-PG665FWX.js → chunk-PEEVPAIJ.js} +9 -9
- package/dist/{chunk-E4YSP5RD.js → chunk-Q6BY4BME.js} +2 -2
- package/dist/{chunk-LC52BB6N.js → chunk-QAR4NYW6.js} +1 -1
- package/dist/{chunk-35DHYR37.js → chunk-QCP4F6EF.js} +1 -1
- package/dist/{chunk-T2VNNW6Z.js → chunk-QMLG5XKP.js} +7 -7
- package/dist/chunk-QSVKEONU.js +2 -0
- package/dist/{chunk-TUT6SGH2.js → chunk-QSW26NAH.js} +1 -1
- package/dist/{chunk-UWNL4FO2.js → chunk-QTK5NV7L.js} +1 -1
- package/dist/{chunk-6AKXEUZA.js → chunk-QTNPOMXM.js} +5 -5
- package/dist/chunk-QYGBWH5J.js +15 -0
- package/dist/{chunk-C4D4L2E5.js → chunk-RPY7FBYY.js} +1 -1
- package/dist/{chunk-SEFPZXO5.js → chunk-S2PKTGHB.js} +6 -6
- package/dist/{chunk-HHXP34PV.js → chunk-SACUPX6L.js} +4 -4
- package/dist/{chunk-LT2MMSHH.js → chunk-SGVIMTN6.js} +16 -16
- package/dist/{chunk-PMJMPYLQ.js → chunk-SLC3KT7F.js} +4 -4
- package/dist/{chunk-LR2X6MKB.js → chunk-SS7BG7BS.js} +1 -1
- package/dist/{chunk-RD5UPROC.js → chunk-TDAFCJY7.js} +6 -6
- package/dist/{chunk-HXXUMKTV.js → chunk-TF3E5J3Y.js} +1 -1
- package/dist/chunk-TQP3L4OC.js +7 -0
- package/dist/{chunk-TLZVEW34.js → chunk-TSOK3QNK.js} +4 -4
- package/dist/chunk-U5KIRPLV.js +2 -0
- package/dist/chunk-U5YJREQJ.js +14 -0
- package/dist/{chunk-3MZTDNAW.js → chunk-UB6TIA2R.js} +1 -1
- package/dist/{chunk-QGU24ERZ.js → chunk-UJULZQM2.js} +1 -1
- package/dist/{chunk-XZLBPVRH.js → chunk-UNDHDLWB.js} +1 -1
- package/dist/chunk-UPHXYWL6.js +15 -0
- package/dist/{chunk-7KZ65FSA.js → chunk-USE4HNZ2.js} +1 -1
- package/dist/{chunk-7IHH5CDD.js → chunk-V5GDA4I6.js} +3 -3
- package/dist/{chunk-JIJOXLDJ.js → chunk-V7NVQ3Z7.js} +1 -1
- package/dist/{chunk-GLVEL6AQ.js → chunk-VKLVHULL.js} +9 -9
- package/dist/chunk-VLKDWKVR.js +1 -0
- package/dist/chunk-VSQSBY2P.js +5 -0
- package/dist/chunk-W4YNYZDQ.js +6 -0
- package/dist/{chunk-TYEXEETI.js → chunk-WDIFRAQM.js} +5 -5
- package/dist/chunk-WEJFTUS7.js +9 -0
- package/dist/{chunk-65HOBHY7.js → chunk-WOHOIJRZ.js} +3 -3
- package/dist/{chunk-AGPQEI3I.js → chunk-WVSLFX37.js} +7 -7
- package/dist/{chunk-BUDBBIKN.js → chunk-WVWIRII2.js} +9 -9
- package/dist/chunk-XDG2RWUO.js +2 -0
- package/dist/{chunk-MV7WC6SL.js → chunk-XINUGME7.js} +45 -45
- package/dist/{chunk-EPGKTANF.js → chunk-XW56UIDQ.js} +6 -6
- package/dist/{chunk-VANXHWGP.js → chunk-Y67ILJVG.js} +1 -1
- package/dist/{chunk-PEELLEPP.js → chunk-YFY2LSWZ.js} +6 -6
- package/dist/{chunk-FARRGETL.js → chunk-YGITR6I5.js} +1 -1
- package/dist/chunk-YULJ7F6Z.js +19 -0
- package/dist/{chunk-PRXPLEVZ.js → chunk-Z3ZIVVKE.js} +1 -1
- package/dist/{chunk-R6XC7X63.js → chunk-Z7PS4QUO.js} +6 -6
- package/dist/chunk-ZGCLFQS5.js +8 -0
- package/dist/{chunk-DVFMCVI5.js → chunk-ZSRYQW64.js} +3 -3
- package/dist/{chunk-YT32RSS6.js → chunk-ZVK74ERI.js} +1 -1
- package/dist/{chunk-6EJ7G234.js → chunk-ZVY4J3PU.js} +7 -7
- package/dist/chunk-ZWQRFYE6.js +11 -0
- package/dist/{client-DLm3Fvbc.d.ts → client-DZeDEyG1.d.ts} +30 -9
- 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/BorderInput.js +1 -1
- package/dist/forms/BrandAssetEditor.js +1 -1
- package/dist/forms/Calendar.js +1 -1
- package/dist/forms/ColorPicker.js +1 -1
- package/dist/forms/ComposerAttachments.js +1 -1
- package/dist/forms/CornersInput.js +1 -1
- package/dist/forms/DatePicker.js +1 -1
- package/dist/forms/DateRangePicker.js +1 -1
- package/dist/forms/DateTimePicker.js +1 -1
- package/dist/forms/DisplayChips.js +1 -1
- package/dist/forms/FilePicker.js +1 -1
- package/dist/forms/FormErrorSummary.js +1 -1
- package/dist/forms/IconPicker.js +1 -1
- package/dist/forms/ImageFocusPoint.js +1 -1
- package/dist/forms/InputNumber.js +1 -1
- package/dist/forms/LinkPicker.js +1 -1
- package/dist/forms/MediaUploadField.js +1 -1
- package/dist/forms/MediaUploadGrid.js +1 -1
- package/dist/forms/MediaUsedInList.d.ts +24 -0
- package/dist/forms/MediaUsedInList.js +2 -0
- package/dist/forms/NumericKeypad.js +1 -1
- package/dist/forms/PositionInput.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/mediaMoveItems.d.ts +31 -0
- package/dist/forms/mediaMoveItems.js +2 -0
- package/dist/forms/useFileIntake.js +1 -1
- package/dist/hooks/useGridSelection.d.ts +70 -0
- package/dist/hooks/useGridSelection.js +2 -0
- package/dist/hooks/useMarquee.d.ts +68 -0
- package/dist/hooks/useMarquee.js +2 -0
- package/dist/icons/index.js +1 -1
- package/dist/index.d.ts +12 -3
- package/dist/index.js +695 -694
- package/dist/locales/zh-Hans.js +1 -1
- package/dist/map/index.js +4 -4
- 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.d.ts +12 -4
- 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.d.ts +18 -2
- 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.d.ts +32 -0
- package/dist/shell/ImageLightbox.js +2 -0
- package/dist/shell/LanguageSelect.js +1 -1
- package/dist/shell/Markdown.js +1 -1
- package/dist/shell/MarqueeBox.d.ts +17 -0
- package/dist/shell/MarqueeBox.js +1 -0
- 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.d.ts +9 -1
- package/dist/shell/PopupMenu.js +1 -1
- package/dist/shell/ProductionTimeline.js +1 -1
- package/dist/shell/ResizeHandle.js +1 -1
- package/dist/shell/Result.js +1 -1
- package/dist/shell/SearchableSelect.js +1 -1
- package/dist/shell/SettingReset.js +1 -1
- package/dist/shell/SettingRow.js +1 -1
- package/dist/shell/SidebarLayout.js +1 -1
- package/dist/shell/SidebarNav.js +1 -1
- package/dist/shell/SortableList.js +1 -1
- package/dist/shell/Statistic.js +1 -1
- package/dist/shell/StepChain.js +1 -1
- package/dist/shell/Stepper.js +1 -1
- package/dist/shell/TimeAgo.js +1 -1
- package/dist/shell/TimelineTrack.js +1 -1
- package/dist/shell/TopNav.js +1 -1
- package/dist/shell/TransferProgress.js +1 -1
- package/dist/shell/Tree.js +1 -1
- package/dist/shell/ZoomableImage.d.ts +49 -0
- package/dist/shell/ZoomableImage.js +2 -0
- package/dist/shell/contextMenuTarget.d.ts +30 -4
- package/dist/shell/contextMenuTarget.js +1 -1
- package/dist/shell/language.js +1 -1
- package/dist/shell/strings.d.ts +23 -0
- package/dist/shell/strings.js +1 -1
- package/dist/shell/toast.js +1 -1
- package/dist/telemetry/index.d.ts +2 -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 +10 -2
- package/dist/ui/index.js +1 -1
- package/dist/utils/edgeScroll.d.ts +25 -0
- package/dist/utils/edgeScroll.js +1 -0
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/Calculator-TYZWIYJW.js +0 -29
- package/dist/Files-BSTDQMII.js +0 -87
- package/dist/PdfViewer-Q7IS273H.js +0 -1
- package/dist/Sidebar-F4LYK5XP.js +0 -43
- package/dist/chunk-26DGOAPH.js +0 -14
- package/dist/chunk-3S52QOEP.js +0 -20
- package/dist/chunk-62LFDQGF.js +0 -15
- package/dist/chunk-6TWRV44R.js +0 -15
- package/dist/chunk-7IF3RZF3.js +0 -15
- package/dist/chunk-7UEFFCQV.js +0 -12
- package/dist/chunk-ARC3R4I2.js +0 -3
- package/dist/chunk-B3LWYJS7.js +0 -2
- package/dist/chunk-ES4HIX3L.js +0 -2
- package/dist/chunk-FEIVDR4M.js +0 -11
- package/dist/chunk-FPI7WBMU.js +0 -8
- package/dist/chunk-GLX6W5W4.js +0 -1
- package/dist/chunk-GZCAFWWB.js +0 -1
- package/dist/chunk-JM2XJJRB.js +0 -6
- package/dist/chunk-OFXGSEYD.js +0 -8
- package/dist/chunk-OVNRVFWS.js +0 -1
- package/dist/chunk-R6N26ITY.js +0 -5
- package/dist/chunk-RKWGWBET.js +0 -9
- package/dist/chunk-TB3AK6XF.js +0 -2
- package/dist/chunk-THCH4PD5.js +0 -1
- package/dist/chunk-UCMPHYBP.js +0 -19
- package/dist/chunk-Y4NIZQNT.js +0 -8
- package/dist/chunk-ZOGEAYWJ.js +0 -9
- /package/dist/{chunk-4MNNVSHD.js → chunk-PCGZS6S4.js} +0 -0
package/README.md
CHANGED
|
@@ -345,7 +345,11 @@ These keep the browser's own menu, on purpose:
|
|
|
345
345
|
own would need a clipboard permission prompt. Non-text inputs (a checkbox, a
|
|
346
346
|
range, a color swatch) have none of that to lose and get the shell menu.
|
|
347
347
|
- **Images, canvases, video and audio.** Save image as, Copy image and the
|
|
348
|
-
playback controls are the browser's to offer.
|
|
348
|
+
playback controls are the browser's to offer. The one exception is opt-in:
|
|
349
|
+
inside a `data-menu-on-media` element (`MENU_ON_MEDIA_ATTR`) a right-click
|
|
350
|
+
on the media opens the surface's own menu. It is for a surface whose whole
|
|
351
|
+
face is the thing its menu acts on, such as a media library tile. See
|
|
352
|
+
[A media tile takes the right-click on its picture](#a-media-tile-takes-the-right-click-on-its-picture).
|
|
349
353
|
- **A long-press on a touch screen**, which is how text gets selected by touch.
|
|
350
354
|
- **Shift+right-click** anywhere, so "Inspect" is still one gesture away for
|
|
351
355
|
developers.
|
|
@@ -731,19 +735,50 @@ third kind) opens the kit's `PopupMenu` at the pointer with `useContextMenu`
|
|
|
731
735
|
and `ContextMenu`, rather than positioning one by hand:
|
|
732
736
|
|
|
733
737
|
```tsx
|
|
734
|
-
import { ContextMenu, useContextMenu,
|
|
738
|
+
import { ContextMenu, useContextMenu, type DropdownMenuEntry } from 'efficient-shell/ui';
|
|
739
|
+
|
|
740
|
+
const rowActions = (row: Row): DropdownMenuEntry[] => [
|
|
741
|
+
{ key: 'duplicate', label: 'Duplicate', onSelect: () => duplicate(row) },
|
|
742
|
+
{
|
|
743
|
+
type: 'submenu', key: 'move', label: 'Move to',
|
|
744
|
+
items: folders.map(f => ({ key: f.id, label: f.name, onSelect: () => move(row, f) })),
|
|
745
|
+
},
|
|
746
|
+
{ type: 'divider', key: 'd' },
|
|
747
|
+
{ key: 'delete', label: 'Delete', danger: true, onSelect: () => remove(row) },
|
|
748
|
+
];
|
|
735
749
|
|
|
736
750
|
const menu = useContextMenu<Row>();
|
|
737
751
|
|
|
738
752
|
<tr onContextMenu={e => menu.open(e, row)}>…</tr>
|
|
739
753
|
{menu.state && (
|
|
740
|
-
<ContextMenu {...menu.props} aria-label={menu.state.data.name}
|
|
741
|
-
<PopupMenuItem onClick={() => { duplicate(menu.state!.data); menu.close(); }}>Duplicate</PopupMenuItem>
|
|
742
|
-
<PopupSubmenu label="Move to">…</PopupSubmenu>
|
|
743
|
-
</ContextMenu>
|
|
754
|
+
<ContextMenu {...menu.props} aria-label={menu.state.data.name} items={rowActions(menu.state.data)} />
|
|
744
755
|
)}
|
|
745
756
|
```
|
|
746
757
|
|
|
758
|
+
**`items` is the same list `DropdownMenu` takes.** `ContextMenu` and
|
|
759
|
+
`DropdownMenu` draw `DropdownMenuEntry` rows with one renderer, so one menu
|
|
760
|
+
definition gives a ⋯ button and a right-click the same rows: actions, links,
|
|
761
|
+
labels, statuses, dividers, radios, check boxes and submenus, with `danger` and
|
|
762
|
+
`disabled`. Write the list once and pass it to both. A `type: 'submenu'` entry
|
|
763
|
+
holds its own `items` and is drawn by `PopupSubmenu`, the kit's one flyout:
|
|
764
|
+
ArrowRight, Enter or a click opens it with focus on its first row, ArrowLeft
|
|
765
|
+
and Escape close it and give focus back to the row, and choosing a row inside
|
|
766
|
+
closes the whole menu. Choosing an action or a
|
|
767
|
+
radio closes the menu and then runs `onSelect`. A check box toggles and the
|
|
768
|
+
menu stays open. A link closes the menu and the browser follows it (`linkAs`
|
|
769
|
+
draws it as your router's link, as in `DropdownMenu`). The arrows walk the
|
|
770
|
+
actions and links and skip labels, statuses and disabled rows.
|
|
771
|
+
|
|
772
|
+
`children` still works: `PopupMenuItem`, `PopupMenuDivider`, `PopupMenuLabel`
|
|
773
|
+
and `PopupSubmenu`, as before. Given both, the `items` rows come first.
|
|
774
|
+
|
|
775
|
+
```tsx
|
|
776
|
+
<ContextMenu {...menu.props} aria-label={menu.state.data.name}>
|
|
777
|
+
<PopupMenuItem onClick={() => { duplicate(menu.state!.data); menu.close(); }}>Duplicate</PopupMenuItem>
|
|
778
|
+
<PopupSubmenu label="Move to">…</PopupSubmenu>
|
|
779
|
+
</ContextMenu>
|
|
780
|
+
```
|
|
781
|
+
|
|
747
782
|
`menu.open(event, data)` takes the event (`preventDefault()`) and returns
|
|
748
783
|
`true`, or leaves it alone and returns `false` where the browser keeps its menu
|
|
749
784
|
or a nearer surface already took it: a text field, an image or media, Shift
|
|
@@ -753,6 +788,30 @@ keyboard's menu key opens it at the focused element. `menu.state` is
|
|
|
753
788
|
`{ x, y, data, owner }` while it is open; `menu.props` is `at`, `owner` and
|
|
754
789
|
`onClose`.
|
|
755
790
|
|
|
791
|
+
#### A media tile takes the right-click on its picture
|
|
792
|
+
|
|
793
|
+
UI-16 leaves a right-click on an image to the browser (Save image as, Copy
|
|
794
|
+
image). A media library tile is the exception: the picture is the file the
|
|
795
|
+
tile's menu renames, moves or trashes, so a right-click anywhere on the tile,
|
|
796
|
+
picture included, must open the same menu as its ⋯ button. The tile opts in
|
|
797
|
+
with `data-menu-on-media` (`MENU_ON_MEDIA_ATTR`):
|
|
798
|
+
|
|
799
|
+
```tsx
|
|
800
|
+
<div data-menu-on-media="" onContextMenu={e => menu.open(e, file)}>
|
|
801
|
+
<img src={file.url} alt="" />
|
|
802
|
+
</div>
|
|
803
|
+
```
|
|
804
|
+
|
|
805
|
+
Inside that element an image, canvas, video or audio no longer keeps the
|
|
806
|
+
browser's menu, and `menu.open` returns `true` on it. Only the media rule is
|
|
807
|
+
lifted. A text field, a textarea, contenteditable and a
|
|
808
|
+
`data-native-context-menu` element inside the tile keep the browser's menu,
|
|
809
|
+
and so do Shift+right-click and a touch long-press. An image outside any
|
|
810
|
+
`data-menu-on-media` element keeps the browser's menu as before. Put the
|
|
811
|
+
browser items the person still needs (Open original, Copy address) in the
|
|
812
|
+
tile's own menu. Use it on a surface whose whole face is what its menu acts
|
|
813
|
+
on, not to take every image's menu.
|
|
814
|
+
|
|
756
815
|
The menu opens at the pointer, placed by `placeAtPoint`, which is `placeMenu`
|
|
757
816
|
with the pointer as its anchor. It stays inside the shell window the
|
|
758
817
|
right-click landed in (UI-11). With no room to the right it opens to the left
|
|
@@ -1485,6 +1544,10 @@ All exports are named — `import { Modal, ... } from 'efficient-shell'`.
|
|
|
1485
1544
|
| `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. |
|
|
1486
1545
|
| `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. |
|
|
1487
1546
|
| `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"). |
|
|
1547
|
+
| `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. |
|
|
1548
|
+
| `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. |
|
|
1549
|
+
| `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`. |
|
|
1550
|
+
| `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. A row that OPENS this list as a submenu is not a `DropdownMenu` entry kind yet. |
|
|
1488
1551
|
| `StartMenu` / `Desktop` / `WindowManagerProvider` | Used internally by `Layout`; rarely instantiated directly. |
|
|
1489
1552
|
| `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"]`. |
|
|
1490
1553
|
| `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`. |
|
|
@@ -3926,6 +3989,25 @@ cannot carry an `Authorization` header. A failed send is dropped and never
|
|
|
3926
3989
|
retried. No user, URL or query string ever leaves the page; a raw path the host
|
|
3927
3990
|
passes as a route is cleaned (query gone, ids made `:id`).
|
|
3928
3991
|
|
|
3992
|
+
**Anonymous mode, for the public storefront** (backend ADR 0057 section 4,
|
|
3993
|
+
s2). `anonymous: true` takes no `getAccessToken` and sends vitals only, to
|
|
3994
|
+
`POST /api/storefront-analytics/web-vitals/` by default, with no
|
|
3995
|
+
`Authorization` header and `credentials: 'omit'`. It listens for no error and
|
|
3996
|
+
leaves the boundary sink alone, so `reportError` does nothing. Nothing is kept
|
|
3997
|
+
in the browser. The sample is drawn once a page load: a load that is sampled
|
|
3998
|
+
out starts nothing at all.
|
|
3999
|
+
|
|
4000
|
+
```ts
|
|
4001
|
+
startClientTelemetry({
|
|
4002
|
+
anonymous: true,
|
|
4003
|
+
app: 'storefront',
|
|
4004
|
+
release: STOREFRONT_VERSION,
|
|
4005
|
+
routeKey: () => routeTemplate, // '/products/[slug]', never the URL
|
|
4006
|
+
endpoint: `${API_URL}/api/storefront-analytics/web-vitals/`,
|
|
4007
|
+
vitalsSampleRate: 0.1, // ADR 0057 decision 7
|
|
4008
|
+
});
|
|
4009
|
+
```
|
|
4010
|
+
|
|
3929
4011
|
**The subpath reaches no package at all**, so dealer and POS, which take only
|
|
3930
4012
|
`efficient-shell/ui`, can report too. `web-vitals` is a pinned devDependency
|
|
3931
4013
|
bundled into it (`tests/telemetryEntryBundlesWebVitals.test.ts`); its licence
|
|
@@ -3934,7 +4016,7 @@ is in `THIRD_PARTY_NOTICES.md`.
|
|
|
3934
4016
|
| Export | Notes |
|
|
3935
4017
|
|---|---|
|
|
3936
4018
|
| `startClientTelemetry(config)` | Starts collecting; a second call replaces the first. Returns `{ flush, reportError, stop }`. `enabled: false`, a missing `window` or an `app`/`release` that is not version-like starts nothing. |
|
|
3937
|
-
| `ClientTelemetryConfig`, `ClientTelemetry` | Types. The subpath also exports the wire types (`TelemetryBatch`, `TelemetryEvent`, `WebVitalEvent`, `ClientErrorEvent`, `ErrorSource`, `DeviceClass`). |
|
|
4019
|
+
| `ClientTelemetryConfig`, `ClientTelemetry` | Types. `ClientTelemetryConfig` is `SignedInClientTelemetryConfig` (with `getAccessToken`) or `AnonymousClientTelemetryConfig` (`anonymous: true`). The subpath also exports the wire types (`TelemetryBatch`, `TelemetryEvent`, `WebVitalEvent`, `ClientErrorEvent`, `ErrorSource`, `DeviceClass`). |
|
|
3938
4020
|
|
|
3939
4021
|
### Open pages as tabs — `efficient-shell/page-tabs`
|
|
3940
4022
|
|
|
@@ -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-6OPAUSMV.js";import{WindowTitle as r}from"./chunk-XINUGME7.js";import"./chunk-TPDOOCFS.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-SS7BG7BS.js";import"./chunk-Y53KNQKL.js";import"./chunk-5A7MWTXX.js";import"./chunk-O5PJELY7.js";import{confirm as n}from"./chunk-SGVIMTN6.js";import"./chunk-CGY5RNAF.js";import"./chunk-VWGWZY7A.js";import"./chunk-PKXQDCNR.js";import"./chunk-UPHXYWL6.js";import"./chunk-5QFPTDQF.js";import"./chunk-UGTRSRIW.js";import"./chunk-QR4RM7PO.js";import"./chunk-LWGNNVDA.js";import"./chunk-KC3EX26K.js";import"./chunk-CDAJKLGL.js";import"./chunk-5SULG7D5.js";import"./chunk-7T3COEQK.js";import"./chunk-AJOWAZ46.js";import"./chunk-UDD7GB4F.js";import"./chunk-K7U4RWXJ.js";import{Icon as a}from"./chunk-42BBJJDP.js";import"./chunk-J75ZT2JQ.js";import"./chunk-4TL3MRRE.js";import"./chunk-Q5MD3VY6.js";import"./chunk-MRJKZWWV.js";import"./chunk-2LXTJXWC.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-GTRUBA2R.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,D]=l(0),[T,U]=l(x),[G,E]=l(!1),[J,M]=l(null),O=s(null),P=s(null);i(()=>{try{localStorage.setItem(d,JSON.stringify(T))}catch{}},[T]);const A=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),E(!1))},K=()=>{"undefined"!=typeof window&&window.open(f,"_blank","noopener,noreferrer")},B=()=>{const e=J?.trim();e?(U(t=>[...t,{label:e,url:f}]),M(null)):M(null)};i(()=>{if(null===J)return;O.current?.focus(),O.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!==J]);const H=e=>{U(t=>t.filter((t,o)=>o!==e))},Q=z>0,X=z<W.length-1,F=T.some(e=>e.url===f),I="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:()=>D(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]),E(!1)}},disabled:!Q,className:I,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]),E(!1)}},disabled:!X,className:I,title:"Forward",children:/* @__PURE__ */m(a,{name:"chevron-right",className:"h-4 w-4",strokeWidth:2})}),
|
|
8
|
+
/* @__PURE__ */m("button",{onClick:()=>D(e=>e+1),className:I,title:"Refresh",children:/* @__PURE__ */m(a,{name:"refresh",className:"h-4 w-4",strokeWidth:1.8})}),
|
|
9
|
+
/* @__PURE__ */m("button",{onClick:()=>A(g),className:I,title:"Home",children:/* @__PURE__ */m(a,{name:"home",className:"h-4 w-4",strokeWidth:1.8})}),
|
|
10
|
+
/* @__PURE__ */m("form",{onSubmit:e=>{e.preventDefault(),A(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:()=>E(e=>!e),className:
|
|
13
|
+
/* @__PURE__ */m("button",{"data-bookmark-popover":!0,onClick:()=>F?H(T.findIndex(e=>e.url===f)):void M(v(f)),className:I+" "+(F?"text-yellow-500":""),title:F?"Remove bookmark":"Add bookmark",children:/* @__PURE__ */m(a,{name:"star",className:"h-4 w-4",fill:F?"currentColor":"none",strokeWidth:1.5})}),
|
|
14
|
+
/* @__PURE__ */m("button",{onClick:K,className:I,title:"Open in new tab",children:/* @__PURE__ */m(a,{name:"external",className:"h-4 w-4",strokeWidth:1.5})}),
|
|
15
|
+
/* @__PURE__ */m("button",{onClick:()=>E(e=>!e),className:I,title:"Embedding help",children:/* @__PURE__ */m(a,{name:"help",className:"h-4 w-4",strokeWidth:1.5})})]}),null!==J&&/* @__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:O,type:"text",value:J,onChange:e=>M(e.target.value),onKeyDown:e=>{"Enter"===e.key?B():"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:B,disabled:!
|
|
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===T.length&&/* @__PURE__ */m("span",{className:"text-2xs text-gray-400 italic px-2",children:"No bookmarks yet — star the address bar to add one."}),T.map((e,t)=>/* @__PURE__ */c("button",{onClick:()=>
|
|
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:B,disabled:!J.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===T.length&&/* @__PURE__ */m("span",{className:"text-2xs text-gray-400 italic px-2",children:"No bookmarks yet — star the address bar to add one."}),T.map((e,t)=>/* @__PURE__ */c("button",{onClick:()=>A(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"})&&H(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:S,iframeRef:
|
|
26
|
+
/* @__PURE__ */m("div",{className:"flex-1 relative min-h-0 bg-gray-50",children:/* @__PURE__ */m(N,{url:f,iframeKey:S,iframeRef:P,openExternal:K,showHelp:G,dismissHelp:()=>E(!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-M7JJOCBU.js";import{useWidgetSettings as n}from"./chunk-XINUGME7.js";import"./chunk-TPDOOCFS.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-SS7BG7BS.js";import"./chunk-Y53KNQKL.js";import"./chunk-5A7MWTXX.js";import"./chunk-O5PJELY7.js";import"./chunk-SGVIMTN6.js";import"./chunk-CGY5RNAF.js";import"./chunk-VWGWZY7A.js";import"./chunk-PKXQDCNR.js";import"./chunk-UPHXYWL6.js";import"./chunk-5QFPTDQF.js";import"./chunk-UGTRSRIW.js";import"./chunk-QR4RM7PO.js";import"./chunk-LWGNNVDA.js";import"./chunk-KC3EX26K.js";import"./chunk-CDAJKLGL.js";import"./chunk-5SULG7D5.js";import"./chunk-7T3COEQK.js";import"./chunk-UDD7GB4F.js";import"./chunk-K7U4RWXJ.js";import{Icon as r}from"./chunk-42BBJJDP.js";import"./chunk-J75ZT2JQ.js";import"./chunk-4TL3MRRE.js";import"./chunk-Q5MD3VY6.js";import"./chunk-MRJKZWWV.js";import"./chunk-2LXTJXWC.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-GTRUBA2R.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,C]=c([]),[v,$]=c(!1),[T,W]=c(()=>e(h)),[E,J]=c(!1),[R,D]=c(T),S=i(null);n(l(()=>{D({...T}),J(!0)},[T]));const G=l(e=>{x(""),k(t=>N||"0"===t?(j(!1),"."===e?"0.":e):"."===e&&t.includes(".")?t:t+e)},[N]),U=l(()=>{k("0"),d(null),g(null),j(!1)},[]),w=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}},[]),L=l(e=>{const t=parseFloat(m);if(null!==p&&b&&!N){const e=w(p,t,b);k(String(e)),d(e),C(n=>[`${p} ${b} ${t} = ${e}`,...n].slice(0,20))}else d(t);g(e),j(!0)},[m,p,b,N,w]),B=l(()=>{if(null===p||!b)return;const e=parseFloat(m),t=w(p,e,b),n=`${p} ${b} ${e} =`;C(e=>[`${n} ${t}`,...e].slice(0,20)),x(n),k(String(t)),d(null),g(null),j(!0)},[m,p,b,w]),M=l(()=>{k(e=>String(parseFloat(e)/100))},[]),A=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"?G(e.key):"."===e.key?G("."):"+"===e.key?L("+"):"-"===e.key?L("-"):"*"===e.key?L("×"):"/"===e.key?(e.preventDefault(),L("÷")):"Enter"===e.key||"="===e.key?("Enter"===e.key&&e.target instanceof Node&&S.current?.contains(e.target)&&e.preventDefault(),B()):"Escape"===e.key?U():"Backspace"===e.key?k(e=>e.length>1?e.slice(0,-1):"0"):"%"===e.key&&M())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[G,L,B,U,M]);const F="flex items-center justify-center rounded-lg text-sm font-medium transition-colors",K=`${F} bg-white border border-gray-200 text-gray-900 hover:bg-gray-50 active:bg-gray-100`,O=`${F} bg-blue-50 border border-blue-200 text-blue-700 hover:bg-blue-100 active:bg-blue-200`,Q=`${F} bg-gray-100 border border-gray-200 text-gray-600 hover:bg-gray-200 active:bg-gray-300`,X=`${F} bg-blue-600 text-white hover:bg-blue-700 active:bg-blue-800`;/* @__PURE__ */
|
|
2
|
+
return s(a,{children:[
|
|
3
|
+
/* @__PURE__ */s("div",{ref:S,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,v?{name:"check",className:"h-5 w-5 text-green-500",strokeWidth:2}:{name:"copy",className:"h-5 w-5",strokeWidth:2})}),
|
|
8
|
+
/* @__PURE__ */u("div",{className:"text-right text-4xl font-mono font-bold text-slate-800 truncate flex-1",children:(e=>{const t=parseFloat(e);return isNaN(t)||e.endsWith(".")||e.endsWith(".0")||Math.abs(t)<1e15&&e.length<16?e:t.toExponential(6)})(m)})]})]}),
|
|
9
|
+
/* @__PURE__ */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:U,className:Q,children:"AC"}),
|
|
11
|
+
/* @__PURE__ */u("button",{onClick:A,className:Q,children:"+/−"}),
|
|
12
|
+
/* @__PURE__ */u("button",{onClick:M,className:Q,children:"%"}),
|
|
13
|
+
/* @__PURE__ */u("button",{onClick:()=>L("÷"),className:`${O} ${"÷"===b?"ring-2 ring-blue-400":""}`,children:"÷"}),
|
|
14
|
+
/* @__PURE__ */u("button",{onClick:()=>G("7"),className:K,children:"7"}),
|
|
15
|
+
/* @__PURE__ */u("button",{onClick:()=>G("8"),className:K,children:"8"}),
|
|
16
|
+
/* @__PURE__ */u("button",{onClick:()=>G("9"),className:K,children:"9"}),
|
|
17
|
+
/* @__PURE__ */u("button",{onClick:()=>L("×"),className:`${O} ${"×"===b?"ring-2 ring-blue-400":""}`,children:"×"}),
|
|
18
|
+
/* @__PURE__ */u("button",{onClick:()=>G("4"),className:K,children:"4"}),
|
|
19
|
+
/* @__PURE__ */u("button",{onClick:()=>G("5"),className:K,children:"5"}),
|
|
20
|
+
/* @__PURE__ */u("button",{onClick:()=>G("6"),className:K,children:"6"}),
|
|
21
|
+
/* @__PURE__ */u("button",{onClick:()=>L("-"),className:`${O} ${"-"===b?"ring-2 ring-blue-400":""}`,children:"−"}),
|
|
22
|
+
/* @__PURE__ */u("button",{onClick:()=>G("1"),className:K,children:"1"}),
|
|
23
|
+
/* @__PURE__ */u("button",{onClick:()=>G("2"),className:K,children:"2"}),
|
|
24
|
+
/* @__PURE__ */u("button",{onClick:()=>G("3"),className:K,children:"3"}),
|
|
25
|
+
/* @__PURE__ */u("button",{onClick:()=>L("+"),className:`${O} ${"+"===b?"ring-2 ring-blue-400":""}`,children:"+"}),
|
|
26
|
+
/* @__PURE__ */u("button",{onClick:()=>G("0"),className:`${K} col-span-2`,children:"0"}),
|
|
27
|
+
/* @__PURE__ */u("button",{onClick:()=>G("."),className:K,children:"."}),
|
|
28
|
+
/* @__PURE__ */u("button",{onClick:B,className:X,children:"="})]})]}),
|
|
29
|
+
/* @__PURE__ */u(t,{open:E,onClose:()=>J(!1),title:"Calculator Settings",appearance:R,onAppearanceChange:D,onSave:()=>{W(R),localStorage.setItem(h,JSON.stringify(R)),J(!1)}})]})}export{m as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{loadAppearance as t,WidgetSettingsModal as e}from"./chunk-
|
|
1
|
+
import{loadAppearance as t,WidgetSettingsModal as e}from"./chunk-M7JJOCBU.js";import{useWidgetSettings as r}from"./chunk-XINUGME7.js";import"./chunk-TPDOOCFS.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-SS7BG7BS.js";import"./chunk-Y53KNQKL.js";import"./chunk-5A7MWTXX.js";import"./chunk-O5PJELY7.js";import"./chunk-SGVIMTN6.js";import"./chunk-CGY5RNAF.js";import"./chunk-VWGWZY7A.js";import"./chunk-PKXQDCNR.js";import"./chunk-UPHXYWL6.js";import"./chunk-5QFPTDQF.js";import"./chunk-UGTRSRIW.js";import"./chunk-QR4RM7PO.js";import"./chunk-LWGNNVDA.js";import"./chunk-KC3EX26K.js";import"./chunk-CDAJKLGL.js";import"./chunk-5SULG7D5.js";import"./chunk-7T3COEQK.js";import"./chunk-UDD7GB4F.js";import"./chunk-K7U4RWXJ.js";import"./chunk-42BBJJDP.js";import"./chunk-J75ZT2JQ.js";import"./chunk-4TL3MRRE.js";import{LoadingSpinner as n}from"./chunk-Q5MD3VY6.js";import"./chunk-MRJKZWWV.js";import"./chunk-2LXTJXWC.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-GTRUBA2R.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({}),[D,S]=s(!1),[v,C]=s(!1),[J,U]=s([]),[R,B]=s(j),[G,L]=s("USD"),[W,A]=s("CNY");r(a(()=>{U([...u]),B({...j}),C(!0)},[u,j])),o(()=>{const t=[...new Set(u.map(([t])=>t))];let e=!0;return async function(){S(!0);const r={};for(const e of t){const t=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),S(!1))}(),()=>{e=!1}},[u]);/* @__PURE__ */
|
|
2
2
|
return c(i,{children:[
|
|
3
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:[D&&/* @__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:[
|
|
@@ -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:R,onAppearanceChange:B,onSave:()=>{if(0===J.length)return;const t=J.slice(0,4);d(t),y(R),localStorage.setItem(p,JSON.stringify(t)),localStorage.setItem(h,JSON.stringify(R)),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:()=>U(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:G,onChange:t=>L(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:()=>{W
|
|
20
|
+
/* @__PURE__ */l("select",{value:W,onChange:t=>A(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:()=>{G!==W&&J.length<4&&U(t=>[...t,[G,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-6OPAUSMV.js";import{WindowTitle as n}from"./chunk-XINUGME7.js";import"./chunk-TPDOOCFS.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-SS7BG7BS.js";import"./chunk-Y53KNQKL.js";import"./chunk-5A7MWTXX.js";import"./chunk-O5PJELY7.js";import"./chunk-SGVIMTN6.js";import"./chunk-CGY5RNAF.js";import"./chunk-VWGWZY7A.js";import"./chunk-PKXQDCNR.js";import{toast_default as r}from"./chunk-HIDOSOI4.js";import{PopupMenu as o,PopupMenuLabel as i,PopupMenuItem as l,PopupMenuDivider as a}from"./chunk-UPHXYWL6.js";import"./chunk-5QFPTDQF.js";import"./chunk-UGTRSRIW.js";import"./chunk-QR4RM7PO.js";import"./chunk-LWGNNVDA.js";import"./chunk-KC3EX26K.js";import"./chunk-CDAJKLGL.js";import"./chunk-5SULG7D5.js";import"./chunk-7T3COEQK.js";import"./chunk-AJOWAZ46.js";import"./chunk-UDD7GB4F.js";import"./chunk-K7U4RWXJ.js";import{Icon as s}from"./chunk-42BBJJDP.js";import"./chunk-J75ZT2JQ.js";import"./chunk-4TL3MRRE.js";import{LoadingSpinner as c}from"./chunk-Q5MD3VY6.js";import"./chunk-MRJKZWWV.js";import"./chunk-2LXTJXWC.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-GTRUBA2R.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),[D,C]=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=>{D&&(D.el.removeAttribute("width"),D.el.removeAttribute("height"),D.el.style.width=e??"",D.el.style.height=e?"auto":"",N(!0),C(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}),
|
|
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/"))?
|
|
5
|
-
/* @__PURE__ */u(n,{title:`${
|
|
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
|
+
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:`${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"}),
|
|
@@ -14,12 +14,12 @@ return h("div",{className:"relative flex flex-col h-full",onDragOver:e=>{e.preve
|
|
|
14
14
|
/* @__PURE__ */h("span",{className:"text-xs font-medium text-gray-700 truncate max-w-[200px]",title:f.filename,children:[f.filename,j?" •":""]}),
|
|
15
15
|
/* @__PURE__ */u("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
|
|
16
16
|
/* @__PURE__ */h("div",{className:"flex items-center gap-0.5",children:[
|
|
17
|
-
/* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>
|
|
18
|
-
/* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>
|
|
19
|
-
/* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>
|
|
20
|
-
/* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>
|
|
17
|
+
/* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>U("bold"),className:"px-2 py-1 text-xs rounded font-bold text-gray-700 hover:bg-gray-200 transition-colors",title:"Bold",children:"B"}),
|
|
18
|
+
/* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>U("italic"),className:"px-2 py-1 text-xs rounded italic text-gray-700 hover:bg-gray-200 transition-colors",title:"Italic",children:"I"}),
|
|
19
|
+
/* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>U("underline"),className:"px-2 py-1 text-xs rounded underline text-gray-700 hover:bg-gray-200 transition-colors",title:"Underline",children:"U"}),
|
|
20
|
+
/* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>U("strikeThrough"),className:"px-2 py-1 text-xs rounded line-through text-gray-700 hover:bg-gray-200 transition-colors",title:"Strikethrough",children:"S"})]}),
|
|
21
21
|
/* @__PURE__ */u("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
|
|
22
|
-
/* @__PURE__ */h("select",{onMouseDown:e=>e.preventDefault(),onChange:e=>{
|
|
22
|
+
/* @__PURE__ */h("select",{onMouseDown:e=>e.preventDefault(),onChange:e=>{U("fontSize",e.target.value),e.currentTarget.value=""},defaultValue:"",className:"text-xs border border-gray-300 rounded px-1 py-0.5 bg-white",children:[
|
|
23
23
|
/* @__PURE__ */u("option",{value:"",disabled:!0,children:"Size"}),
|
|
24
24
|
/* @__PURE__ */u("option",{value:"1",children:"XS"}),
|
|
25
25
|
/* @__PURE__ */u("option",{value:"2",children:"S"}),
|
|
@@ -27,21 +27,21 @@ return h("div",{className:"relative flex flex-col h-full",onDragOver:e=>{e.preve
|
|
|
27
27
|
/* @__PURE__ */u("option",{value:"4",children:"L"}),
|
|
28
28
|
/* @__PURE__ */u("option",{value:"5",children:"XL"}),
|
|
29
29
|
/* @__PURE__ */u("option",{value:"6",children:"2XL"})]}),
|
|
30
|
-
/* @__PURE__ */u("input",{type:"color",defaultValue:"#000000",onChange:e=>
|
|
30
|
+
/* @__PURE__ */u("input",{type:"color",defaultValue:"#000000",onChange:e=>U("foreColor",e.target.value),className:"w-7 h-6 border border-gray-300 rounded cursor-pointer",title:"Text color"}),
|
|
31
31
|
/* @__PURE__ */u("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
|
|
32
|
-
/* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>
|
|
33
|
-
/* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>
|
|
32
|
+
/* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>U("insertUnorderedList"),className:"px-2 py-1 text-xs rounded text-gray-700 hover:bg-gray-200 transition-colors",title:"Bulleted list",children:"• List"}),
|
|
33
|
+
/* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>U("insertOrderedList"),className:"px-2 py-1 text-xs rounded text-gray-700 hover:bg-gray-200 transition-colors",title:"Numbered list",children:"1."}),
|
|
34
34
|
/* @__PURE__ */u("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
|
|
35
35
|
/* @__PURE__ */h("div",{className:"flex items-center gap-0.5",children:[
|
|
36
|
-
/* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>
|
|
37
|
-
/* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>
|
|
38
|
-
/* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>
|
|
39
|
-
/* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>
|
|
36
|
+
/* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>U("justifyLeft"),className:"px-2 py-1 rounded text-gray-700 hover:bg-gray-200 transition-colors",title:"Align left",children:/* @__PURE__ */u("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */u("path",{strokeLinecap:"round",d:"M3.75 6h16.5M3.75 12h9.75M3.75 18h14.25"})})}),
|
|
37
|
+
/* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>U("justifyCenter"),className:"px-2 py-1 rounded text-gray-700 hover:bg-gray-200 transition-colors",title:"Align center",children:/* @__PURE__ */u("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */u("path",{strokeLinecap:"round",d:"M3.75 6h16.5M7.125 12h9.75M4.875 18h14.25"})})}),
|
|
38
|
+
/* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>U("justifyRight"),className:"px-2 py-1 rounded text-gray-700 hover:bg-gray-200 transition-colors",title:"Align right",children:/* @__PURE__ */u("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */u("path",{strokeLinecap:"round",d:"M3.75 6h16.5M10.5 12h9.75M6 18h14.25"})})}),
|
|
39
|
+
/* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>U("justifyFull"),className:"px-2 py-1 rounded text-gray-700 hover:bg-gray-200 transition-colors",title:"Justify",children:/* @__PURE__ */u("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */u("path",{strokeLinecap:"round",d:"M3.75 6h16.5M3.75 12h16.5M3.75 18h16.5"})})})]}),
|
|
40
40
|
/* @__PURE__ */u("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
|
|
41
|
-
/* @__PURE__ */u("input",{ref:M,type:"file",accept:"image/*",multiple:!0,className:"hidden",onChange:e=>{e.target.files?.length&&
|
|
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(),C({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"})}),D&&/* @__PURE__ */h(o,{minWidth:150,style:{left:D.x,top:D.y},onClose:()=>C(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:()=>{D?.el.remove(),N(!0),C(null)},children:"Remove image"})]})]})}export{f as default};
|