efficient-shell 12.28.0 → 12.32.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 +81 -1
- package/dist/{Browser-PC45PVTN.js → Browser-36SDGA64.js} +16 -16
- package/dist/Calculator-GDHNFSB6.js +29 -0
- package/dist/{CurrencyConverter-BB4QWNER.js → CurrencyConverter-PXCCCUS2.js} +9 -9
- package/dist/Files-NVUIAUO5.js +141 -0
- package/dist/{Notepad-BLUA2254.js → Notepad-QA2CD6GC.js} +8 -8
- package/dist/PdfViewer-627HEAIL.js +1 -0
- package/dist/{PomodoroTimer-KIJKDHVO.js → PomodoroTimer-HD2ZNOUV.js} +68 -68
- package/dist/{Preview-JVL2N5GN.js → Preview-FW2KT6FQ.js} +29 -29
- package/dist/Sidebar-QNJNEBT2.js +44 -0
- package/dist/{Stock-JQEJMIMG.js → Stock-EDZSOJAQ.js} +3 -3
- package/dist/{Weather-FAQX55XL.js → Weather-OTVZZEE7.js} +18 -18
- package/dist/{WorldClock-YSZNGEL2.js → WorldClock-PDKFE5S7.js} +6 -6
- package/dist/ai/index.js +111 -111
- package/dist/apps/ImageAnnotator.js +1 -1
- package/dist/apps/index.js +1 -1
- package/dist/bin/media-host-check.js +1 -1
- package/dist/bin/ui-check.js +1 -1
- package/dist/brand.css +1 -1
- package/dist/charts/BoxPlotChart.js +1 -1
- package/dist/charts/CandlestickChart.js +1 -1
- package/dist/charts/CartesianPlot.js +1 -1
- package/dist/charts/ChartBrush.js +1 -1
- package/dist/charts/ChartFrame.js +1 -1
- package/dist/charts/ChartSkeleton.js +1 -1
- package/dist/charts/ChordChart.js +1 -1
- package/dist/charts/ColumnChart.js +1 -1
- package/dist/charts/FunnelChart.js +1 -1
- package/dist/charts/HeatmapChart.js +1 -1
- package/dist/charts/HistogramChart.js +1 -1
- package/dist/charts/Meter.js +1 -1
- package/dist/charts/PieChart.js +1 -1
- package/dist/charts/RadarChart.js +1 -1
- package/dist/charts/RadialBarChart.js +1 -1
- package/dist/charts/RangeChart.js +1 -1
- package/dist/charts/RankedBars.js +1 -1
- package/dist/charts/SankeyChart.js +1 -1
- package/dist/charts/ScatterChart.js +1 -1
- package/dist/charts/SpecChart.js +1 -1
- package/dist/charts/StatTile.js +1 -1
- package/dist/charts/SunburstChart.js +1 -1
- package/dist/charts/TimeSeriesChart.js +1 -1
- package/dist/charts/TreemapChart.js +1 -1
- package/dist/charts/WaterfallChart.js +1 -1
- package/dist/{chunk-TKIYZE7V.js → chunk-246K337V.js} +1 -1
- package/dist/{chunk-TGLUENXE.js → chunk-25M4CAB3.js} +1 -1
- package/dist/{chunk-VBLCYL4L.js → chunk-26Y66IXU.js} +2 -2
- package/dist/chunk-2PNG5UR6.js +22 -0
- package/dist/chunk-3ECUHYHI.js +28 -0
- package/dist/{chunk-ZGWXSHVM.js → chunk-3MAGUYG2.js} +1 -1
- package/dist/{chunk-4PIQG2ZK.js → chunk-3TR6C5V4.js} +1 -1
- package/dist/{chunk-NOGSS432.js → chunk-3UMS74TZ.js} +1 -1
- package/dist/{chunk-GC4N4UQM.js → chunk-4U2OUX65.js} +5 -5
- package/dist/{chunk-MKNDDB6U.js → chunk-4XN6ACGV.js} +1 -1
- package/dist/{chunk-232YPI2L.js → chunk-555KW6TM.js} +4 -4
- package/dist/{chunk-6KOMF6WL.js → chunk-5OJFYNEZ.js} +1 -1
- package/dist/{chunk-SE6IQZYW.js → chunk-5R3NDBCD.js} +9 -9
- package/dist/{chunk-RBS3AWE7.js → chunk-5XHJ3H6Y.js} +4 -4
- package/dist/{chunk-XHSMDUEW.js → chunk-5XOF3O4B.js} +3 -3
- package/dist/{chunk-N2445WHJ.js → chunk-6AAGZ34A.js} +9 -9
- package/dist/{chunk-CON5NRCO.js → chunk-6MA7VXZR.js} +2 -2
- package/dist/{chunk-VLBIM33E.js → chunk-6ZTVZIPI.js} +6 -6
- package/dist/chunk-7CHEHWGL.js +9 -0
- package/dist/{chunk-XAEI36TW.js → chunk-7IRO4JAA.js} +1 -1
- package/dist/{chunk-JFGJJNT2.js → chunk-7JR2O3IX.js} +6 -6
- package/dist/{chunk-7TNZ3DTT.js → chunk-A6YUCAGF.js} +2 -2
- package/dist/{chunk-HSUTZCRT.js → chunk-A7JAHN75.js} +1 -1
- package/dist/chunk-ADNUV6OV.js +8 -0
- package/dist/chunk-AFLG5E4O.js +7 -0
- package/dist/{chunk-7K3FYCRZ.js → chunk-AFVI75RH.js} +9 -9
- package/dist/{chunk-WN3JHPJI.js → chunk-AGNHOSES.js} +6 -6
- package/dist/{chunk-63IGYBCQ.js → chunk-AJ2EEWZT.js} +2 -2
- package/dist/chunk-AWY2ZOXT.js +14 -0
- package/dist/{chunk-Y7KDCC6E.js → chunk-B7UT3W4C.js} +1 -1
- package/dist/chunk-BEN2LJWQ.js +5 -0
- package/dist/{chunk-QADNVFV5.js → chunk-BIBQAEHV.js} +1 -1
- package/dist/{chunk-AMIMNRYU.js → chunk-BLC6HAU3.js} +1 -1
- package/dist/{chunk-ZBJ7FTA5.js → chunk-BXPEEPYH.js} +1 -1
- package/dist/{chunk-CBVKGAZH.js → chunk-CAIUI3DC.js} +1 -1
- package/dist/{chunk-XSVQ5V7L.js → chunk-CHRK5R3Y.js} +9 -9
- package/dist/{chunk-7GJIIBJD.js → chunk-COF2CF5R.js} +1 -1
- package/dist/{chunk-ZGCCV4WE.js → chunk-CYTK7DCA.js} +6 -6
- package/dist/{chunk-HNEI2RKX.js → chunk-DGFC5BX4.js} +1 -1
- package/dist/{chunk-NUPK6CUV.js → chunk-DHLXSL3Y.js} +1 -1
- package/dist/{chunk-GEVNBBM7.js → chunk-DRIO2Y4R.js} +4 -4
- package/dist/{chunk-EEB5XPWP.js → chunk-DWGMTMDU.js} +1 -1
- package/dist/{chunk-XKNKRKHH.js → chunk-E6GGE7E5.js} +15 -15
- package/dist/{chunk-LAO6GLBY.js → chunk-FE6J5S5X.js} +6 -6
- package/dist/chunk-FKJPBQ6I.js +7 -0
- package/dist/{chunk-V3XS6BTJ.js → chunk-FXS2P23Q.js} +12 -12
- package/dist/chunk-G3NE4SGZ.js +11 -0
- package/dist/{chunk-WNOXHJVT.js → chunk-GX4CDXPK.js} +7 -7
- package/dist/chunk-H74VN7OI.js +2 -0
- package/dist/chunk-H7WMOY62.js +1 -0
- package/dist/{chunk-WPG3ZHYT.js → chunk-HGGDOMBV.js} +1 -1
- package/dist/{chunk-DIHHV6T6.js → chunk-HWV6UDFC.js} +1 -1
- package/dist/{chunk-HVYXJLAV.js → chunk-IBLRSK7V.js} +1 -1
- package/dist/{chunk-TDXRG43I.js → chunk-IE5XWHDU.js} +1 -1
- package/dist/chunk-IESNUXYH.js +1 -0
- package/dist/chunk-IYM5N7FH.js +4 -0
- package/dist/{chunk-KAKJ7ENS.js → chunk-J44SUUOG.js} +2 -2
- package/dist/chunk-JI55MXP4.js +12 -0
- package/dist/{chunk-X5MUSNKH.js → chunk-JIBU7YY4.js} +2 -2
- package/dist/{chunk-CMJD5URC.js → chunk-JLQ7N54N.js} +20 -20
- package/dist/chunk-JROPOGQP.js +2 -0
- package/dist/{chunk-N5RV73CI.js → chunk-JTJDXCJU.js} +4 -4
- package/dist/{chunk-SS3CROPR.js → chunk-JYVHFRKK.js} +5 -5
- package/dist/{chunk-56XCGOX5.js → chunk-JZ4V3RHK.js} +4 -4
- package/dist/{chunk-YO26RV3H.js → chunk-K4BM6PPZ.js} +1 -1
- package/dist/{chunk-DGHSCKOE.js → chunk-K4RY57UX.js} +4 -4
- package/dist/{chunk-FJVZ2W55.js → chunk-K73KBA5C.js} +4 -4
- package/dist/{chunk-V4XR4MOS.js → chunk-KDG7NWYX.js} +1 -1
- package/dist/{chunk-3YBXA72C.js → chunk-KFNQVNND.js} +1 -1
- package/dist/{chunk-24Y5JHIR.js → chunk-KTKFCR6T.js} +1 -1
- package/dist/chunk-L6XEON5Q.js +1 -0
- package/dist/{chunk-BT2YPDQL.js → chunk-LNXYVWEF.js} +3 -3
- package/dist/{chunk-574SLTKO.js → chunk-LOJAJARD.js} +8 -8
- package/dist/{chunk-JLRF6FN7.js → chunk-LOMNX5VH.js} +1 -1
- package/dist/{chunk-RZ2DWX4N.js → chunk-LQC5U5YT.js} +4 -4
- package/dist/chunk-LUAA4LKY.js +19 -0
- package/dist/{chunk-LL4KF43W.js → chunk-M2TQQKJO.js} +1 -1
- package/dist/chunk-M3D5FW5R.js +6 -0
- package/dist/{chunk-OXRQIWRT.js → chunk-M3FBPZ4G.js} +1 -1
- package/dist/{chunk-RVVQDBV7.js → chunk-MMSQZKJY.js} +5 -5
- package/dist/{chunk-4LOHQ4QB.js → chunk-NDGPJKE3.js} +5 -5
- package/dist/chunk-NMWV6BOL.js +8 -0
- package/dist/{chunk-O4YKOS74.js → chunk-NQ43KRRX.js} +9 -9
- package/dist/{chunk-SR4W2SYQ.js → chunk-NQA267J3.js} +8 -8
- package/dist/{chunk-75H4BWNC.js → chunk-NZ74N2IQ.js} +1 -1
- package/dist/{chunk-YYGJJ6EI.js → chunk-OA55OBDP.js} +1 -1
- package/dist/{chunk-47UH3D4B.js → chunk-OL2XKAX2.js} +1 -1
- package/dist/{chunk-WX2Q76WC.js → chunk-OQGCQQ7H.js} +6 -6
- package/dist/{chunk-OMFYTCBI.js → chunk-OU3J5TOO.js} +1 -1
- package/dist/{chunk-VFHKD7TQ.js → chunk-OWFJRER6.js} +1 -1
- package/dist/{chunk-MTYEY7HT.js → chunk-PK5KDLIG.js} +13 -13
- package/dist/chunk-PPVZMIBL.js +4 -0
- package/dist/{chunk-UEFIUTOU.js → chunk-PR5CON2G.js} +1 -1
- package/dist/chunk-PTEKHRNX.js +26 -0
- package/dist/{chunk-Z66QBDNU.js → chunk-PUXSFLWR.js} +1 -1
- package/dist/{chunk-VEQ45GAH.js → chunk-Q2LKH6RN.js} +1 -1
- package/dist/{chunk-NN32QUCE.js → chunk-Q2T5DRIK.js} +1 -1
- package/dist/{chunk-2DYVVHZA.js → chunk-QB4LAGMN.js} +1 -1
- package/dist/{chunk-GUHCKMC7.js → chunk-QBQMMOP6.js} +2 -2
- package/dist/{chunk-LIWBCIRZ.js → chunk-QJ6HVBAA.js} +5 -5
- package/dist/{chunk-W2663E4S.js → chunk-QPSKEDR7.js} +3 -3
- package/dist/{chunk-BKYRHQK2.js → chunk-QTWHMCCX.js} +11 -11
- package/dist/{chunk-MWTCGJAI.js → chunk-QUN3RSMN.js} +1 -1
- package/dist/{chunk-3FBXJO77.js → chunk-QXLYU5FR.js} +1 -1
- package/dist/{chunk-HLE4LTRU.js → chunk-QXTCEUFC.js} +1 -1
- package/dist/{chunk-7ZJRBFHA.js → chunk-QYKWVZ3R.js} +1 -1
- package/dist/{chunk-ATZ262BR.js → chunk-R3W6LZBG.js} +1 -1
- package/dist/{chunk-AFWLCXQD.js → chunk-R3ZEDJDZ.js} +7 -7
- package/dist/{chunk-DG2TGWXI.js → chunk-RIULA2CH.js} +11 -11
- package/dist/{chunk-2OUAPOLK.js → chunk-RLFZRIO4.js} +1 -1
- package/dist/{chunk-TU2L7NW3.js → chunk-RPSNYIDY.js} +5 -5
- package/dist/{chunk-WXZZGHET.js → chunk-RSRTE7RG.js} +1 -1
- package/dist/{chunk-EATV7FMU.js → chunk-S54Z2JAZ.js} +8 -8
- package/dist/{chunk-H2CPT6K3.js → chunk-T5UMQZ5X.js} +12 -12
- package/dist/{chunk-IB3LLQZC.js → chunk-TBXFRW3E.js} +1 -1
- package/dist/{chunk-JZBLOIL7.js → chunk-UJ23EKXU.js} +1 -1
- package/dist/{chunk-VLKJN6HX.js → chunk-V2OE6OTK.js} +13 -13
- package/dist/{chunk-EWVE5XG6.js → chunk-V7BHDLP2.js} +1 -1
- package/dist/{chunk-6Q7L32LL.js → chunk-VERSP62V.js} +1 -1
- package/dist/{chunk-QB2GJNGB.js → chunk-VI54L75G.js} +8 -8
- package/dist/{chunk-TYQ2JL4J.js → chunk-VTDW5GLS.js} +1 -1
- package/dist/chunk-VVI4Y6XA.js +23 -0
- package/dist/{chunk-BC4FE77W.js → chunk-VW3ZUWW2.js} +62 -62
- package/dist/{chunk-74JMBOQH.js → chunk-WJTZE3PL.js} +27 -27
- package/dist/chunk-WW5AXVBX.js +2 -0
- package/dist/{chunk-RF3ZFTAU.js → chunk-X4IFSC57.js} +1 -1
- package/dist/{chunk-OOWPLQD5.js → chunk-X6AMAYXV.js} +2 -2
- package/dist/{chunk-XAF5ZI7H.js → chunk-XBC7CBVJ.js} +1 -1
- package/dist/{chunk-T7D73HT7.js → chunk-XFC7AWPW.js} +10 -10
- package/dist/{chunk-4BKJ6A5H.js → chunk-XKBCF6SK.js} +10 -10
- package/dist/chunk-XOQH6VSU.js +14 -0
- package/dist/{chunk-4IHYWLWE.js → chunk-XOXTMWV3.js} +2 -2
- package/dist/{chunk-OM6VWUAZ.js → chunk-XR7SPONC.js} +1 -1
- package/dist/{chunk-UH5ZGWSA.js → chunk-Y7XX6Z3M.js} +7 -7
- package/dist/chunk-YELYAGCX.js +13 -0
- package/dist/{chunk-DJXXY23A.js → chunk-YG6ONZIB.js} +2 -2
- package/dist/{chunk-CEIIQRK5.js → chunk-ZFQI3EVU.js} +5 -5
- package/dist/{chunk-VP2GI3UP.js → chunk-ZGY2OK7Q.js} +8 -8
- package/dist/{chunk-YWNHK6Z5.js → chunk-ZHVWK5NL.js} +17 -17
- package/dist/{chunk-34L5SRM7.js → chunk-ZP3UAWJL.js} +18 -18
- package/dist/data/DataTable.js +1 -1
- package/dist/data/EntityList.js +1 -1
- package/dist/data/Gantt.d.ts +107 -0
- package/dist/data/Gantt.js +2 -0
- package/dist/data/Kanban.js +1 -1
- package/dist/data/ListFooter.js +1 -1
- package/dist/data/ListLoadError.js +1 -1
- package/dist/data/Pagination.js +1 -1
- package/dist/data/ResizableTable.js +1 -1
- package/dist/file-intake/index.js +1 -1
- package/dist/forms/BorderInput.js +1 -1
- package/dist/forms/BrandAssetEditor.js +1 -1
- package/dist/forms/Calendar.js +1 -1
- package/dist/forms/ColorPicker.js +1 -1
- package/dist/forms/ComposerAttachments.js +1 -1
- package/dist/forms/CornersInput.js +1 -1
- package/dist/forms/DatePicker.js +1 -1
- package/dist/forms/DateRangePicker.js +1 -1
- package/dist/forms/DateTimePicker.js +1 -1
- package/dist/forms/DisplayChips.js +1 -1
- package/dist/forms/FilePicker.js +1 -1
- package/dist/forms/FormErrorSummary.js +1 -1
- package/dist/forms/IconPicker.js +1 -1
- package/dist/forms/ImageFocusPoint.js +1 -1
- package/dist/forms/InputNumber.js +1 -1
- package/dist/forms/LinkPicker.js +1 -1
- package/dist/forms/MediaLibrary.js +1 -1
- package/dist/forms/MediaUploadField.js +1 -1
- package/dist/forms/MediaUploadGrid.js +1 -1
- package/dist/forms/MediaUsedInList.js +1 -1
- package/dist/forms/NumericKeypad.js +1 -1
- package/dist/forms/PictureTiles.d.ts +14 -2
- package/dist/forms/PictureTiles.js +1 -1
- package/dist/forms/PositionInput.js +1 -1
- package/dist/forms/Select.js +1 -1
- package/dist/forms/SidesInput.d.ts +13 -2
- package/dist/forms/SidesInput.js +1 -1
- package/dist/forms/Slider.js +1 -1
- package/dist/forms/Snippet.js +1 -1
- package/dist/forms/TagInput.js +1 -1
- package/dist/forms/TextToolbar.js +1 -1
- package/dist/forms/TimePicker.js +1 -1
- package/dist/forms/WidthsBar.js +1 -1
- package/dist/forms/mediaLibraryMenu.js +1 -1
- package/dist/forms/mediaMoveItems.js +1 -1
- package/dist/forms/textAlign.js +1 -1
- package/dist/forms/useFileIntake.js +1 -1
- package/dist/icons/efficient-glyphs.js +1 -1
- package/dist/icons/efficient-looks.js +1 -1
- package/dist/icons/efficient.js +1 -1
- package/dist/icons/looks/map.js +1 -1
- package/dist/icons/payment.js +1 -1
- package/dist/icons/sets.js +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.js +665 -665
- package/dist/locales/zh-Hans.js +1 -1
- package/dist/map/index.js +4 -4
- package/dist/model-viewer/index.d.ts +123 -0
- package/dist/model-viewer/index.js +7 -0
- 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/CountBadge.js +1 -1
- package/dist/shell/Dialog.js +1 -1
- package/dist/shell/Drawer.js +1 -1
- package/dist/shell/EditableGrid.js +1 -1
- package/dist/shell/EmptyState.js +1 -1
- package/dist/shell/GlobalSearch.js +1 -1
- package/dist/shell/HelpCenter.js +1 -1
- package/dist/shell/IconRail.js +1 -1
- package/dist/shell/ImageLightbox.js +1 -1
- package/dist/shell/ItemCount.js +1 -1
- package/dist/shell/LanguageSelect.js +1 -1
- package/dist/shell/Markdown.js +1 -1
- package/dist/shell/MetricBar.js +1 -1
- package/dist/shell/MetricBarLegend.js +1 -1
- package/dist/shell/MilestoneTimeline.js +1 -1
- package/dist/shell/PageHeader.js +1 -1
- package/dist/shell/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/TimeAgo.js +1 -1
- package/dist/shell/TimelineTrack.js +1 -1
- package/dist/shell/TransferProgress.js +1 -1
- package/dist/shell/Tree.js +1 -1
- package/dist/shell/discardGuard.js +1 -1
- package/dist/shell/language.js +1 -1
- package/dist/shell/strings.d.ts +32 -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 +3 -2
- package/dist/ui/index.js +1 -1
- package/dist/ui.css +35 -0
- package/dist/version.js +1 -1
- package/package.json +12 -1
- package/dist/Calculator-5TRNFPY4.js +0 -29
- package/dist/Files-BKEREVQK.js +0 -141
- package/dist/PdfViewer-4YLDY4JY.js +0 -1
- package/dist/Sidebar-SAGLPIOC.js +0 -44
- package/dist/chunk-2SGOKMUU.js +0 -13
- package/dist/chunk-4Y33Y4OX.js +0 -8
- package/dist/chunk-64J7TYJ3.js +0 -4
- package/dist/chunk-A4PFVMQ2.js +0 -7
- package/dist/chunk-BFRGDRFK.js +0 -23
- package/dist/chunk-BHHFVIAD.js +0 -2
- package/dist/chunk-DRMIQ3YE.js +0 -1
- package/dist/chunk-ENFXDIIZ.js +0 -8
- package/dist/chunk-FFUTSMF5.js +0 -28
- package/dist/chunk-FI6IJTAJ.js +0 -14
- package/dist/chunk-FVKXDF2Q.js +0 -12
- package/dist/chunk-GCTJIZTJ.js +0 -2
- package/dist/chunk-IATKDC52.js +0 -9
- package/dist/chunk-JJ2OXUK7.js +0 -14
- package/dist/chunk-JSHMIMAJ.js +0 -1
- package/dist/chunk-K5PDLRYH.js +0 -11
- package/dist/chunk-S6AN76R3.js +0 -4
- package/dist/chunk-UFM4YBZ7.js +0 -1
- package/dist/chunk-VDYF3WPJ.js +0 -2
- package/dist/chunk-WKYNPGFB.js +0 -7
- package/dist/chunk-XMY2HKVD.js +0 -19
- package/dist/chunk-XQWHKXLS.js +0 -22
- package/dist/chunk-Y4FWTYZS.js +0 -6
- package/dist/chunk-YX2OOGV7.js +0 -4
- /package/dist/{chunk-GMHMWDXU.js → chunk-KH3253OM.js} +0 -0
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
import{toast_default as e}from"./chunk-
|
|
1
|
+
import{toast_default as e}from"./chunk-KFNQVNND.js";import{useShellStrings as t}from"./chunk-L6XEON5Q.js";import{forwardRef as r,useRef as n,useState as o,useMemo as i,useEffect as a,useImperativeHandle as l}from"react";import{jsx as s,jsxs as c,Fragment as d}from"react/jsx-runtime";var h=["#ef4444","#f97316","#eab308","#22c55e","#3b82f6","#8b5cf6","#000000","#ffffff"],u=[{id:"system",name:"fontSystem",css:"-apple-system, system-ui, sans-serif"},{id:"serif",name:"fontSerif",css:'Georgia, "Times New Roman", serif'},{id:"mono",name:"fontMono",css:'ui-monospace, "SF Mono", Menlo, monospace'},{id:"cursive",name:"fontCursive",css:'"Brush Script MT", "Comic Sans MS", cursive'}],p=()=>Math.random().toString(36).slice(2,9),y=r(function({src:r,filename:y,onApply:m,onCancel:g},N){const L=n(null),z=n(null),D=n(null),E=n(null),P=t().annotator,$=n(P);$.current=P;const[I,S]=o("select"),[W,B]=o(h[0]),[R,j]=o(4),[F,H]=o(24),[T,U]=o(u[0].id),[A,O]=o(!0),[K,V]=o(!1),[X,Z]=o(!1),[q,G]=o(null),[Q,Y]=o(null),[_,J]=o(6),[ee,te]=o(12),[re,ne]=o([]),[oe,ie]=o(null),[ae,le]=o(null),[se,ce]=o(null),[de,he]=o(1),[ue,pe]=o(null),[ye,xe]=o(null),[me,ge]=o(null),we=n(null),[fe,ve]=o(!1),be=i(()=>se?{w:se.w*de,h:se.h*de}:null,[se,de]),ke=be&&ae?be.w/ae.w:1,Me=i(()=>re.find(e=>e.id===oe)??null,[re,oe]);a(()=>{"select"===I&&Me&&("color"in Me&&B(Me.color),"stroke"in Me&&j(Me.stroke),"rect"===Me.type&&te(Me.radius),"text"===Me.type&&(H(Me.size),U(Me.font),O(Me.bold),V(Me.italic),Z(Me.underline),G(Me.borderColor),Y(Me.background),J(Me.padding)))},[oe]),a(()=>{const t=new Image;t.crossOrigin="anonymous",t.onload=()=>{E.current=t,le({w:t.naturalWidth,h:t.naturalHeight}),ne([]),ie(null)},t.onerror=()=>e.error($.current.loadFailed),t.src=r},[r]),a(()=>{if(!ae)return;const e=()=>{const e=L.current;if(!e)return;const t=e.getBoundingClientRect(),r=Math.max(0,t.width-32),n=Math.max(0,t.height-32);if(0===r||0===n)return;const o=ae.w/ae.h;let i=ae.w,a=ae.h;i>r&&(i=r,a=i/o),a>n&&(a=n,i=a*o),ce({w:i,h:a})};e();const t=new ResizeObserver(e);return L.current&&t.observe(L.current),()=>t.disconnect()},[ae]);const Ne=i(()=>re.filter(e=>"mosaic"===e.type),[re]);a(()=>{const e=E.current,t=z.current;if(!e||!t||!ae)return;t.width=ae.w,t.height=ae.h;const r=t.getContext("2d");r.drawImage(e,0,0);for(const e of Ne)C(r,e)},[ae,Ne,se]);const Ce=e=>{const t=D.current;if(!t)return{x:0,y:0};const r=t.createSVGPoint();r.x=e.clientX,r.y=e.clientY;const n=t.getScreenCTM();if(!n)return{x:0,y:0};const o=r.matrixTransform(n.inverse());return{x:o.x,y:o.y}},Le=e=>{we.current=e,ve(!0)};a(()=>{if(!fe)return;const e=e=>{const t=we.current;if(!t)return;const r=Ce(e);if("draw"===t.kind)pe(v(I,t.start,r,W,R,ee));else if("pen"===t.kind){const e=t.points[t.points.length-1];(Math.abs(r.x-e.x)>1||Math.abs(r.y-e.y)>1)&&(t.points.push(r),pe({id:"",type:"draw",points:t.points.slice(),color:W,stroke:R}))}else if("crop"===t.kind)ge(M(t.start,r));else if("move"===t.kind){const e=r.x-t.start.x,n=r.y-t.start.y;ne(r=>r.map(r=>r.id===t.id?b(t.original,e,n):r))}else"resize"===t.kind&&ne(e=>e.map(e=>e.id===t.id?function(e,t,r){if("arrow"===e.type)return"start"===t?{...e,x1:r.x,y1:r.y}:"end"===t?{...e,x2:r.x,y2:r.y}:e;if("text"===e.type||"draw"===e.type)return e;const n=e.x,o=e.x+e.w,i=e.y,a=e.y+e.h;let l=n,s=i,c=o,d=a;"nw"===t&&(l=r.x,s=r.y);"ne"===t&&(c=r.x,s=r.y);"se"===t&&(c=r.x,d=r.y);"sw"===t&&(l=r.x,d=r.y);const h=M({x:l,y:s},{x:c,y:d});return{...e,x:h.x,y:h.y,w:h.w,h:h.h}}(t.original,t.corner,r):e))},t=()=>{const e=we.current;if(we.current=null,ve(!1),"draw"===e?.kind)pe(e=>{if(!e||("arrow"===(t=e).type?Math.abs(t.x2-t.x1)<4&&Math.abs(t.y2-t.y1)<4:"draw"===t.type?t.points.length<2:"w"in t&&"h"in t&&(t.w<4||t.h<4)))return null;var t;const r={...e,id:p()};return ne(e=>[...e,r]),ie(r.id),S("select"),null});else if("pen"===e?.kind){if(e.points.length<2)return void pe(null);const t={id:p(),type:"draw",points:e.points,color:W,stroke:R};ne(e=>[...e,t]),ie(t.id),S("select"),pe(null)}};return window.addEventListener("pointermove",e),window.addEventListener("pointerup",t),window.addEventListener("pointercancel",t),()=>{window.removeEventListener("pointermove",e),window.removeEventListener("pointerup",t),window.removeEventListener("pointercancel",t)}},[fe,I,W,R,ee]);a(()=>{const e=e=>{if(!document.activeElement||!/^(INPUT|TEXTAREA)$/.test(document.activeElement.tagName))return!e.metaKey&&!e.ctrlKey||"z"!==e.key&&"Z"!==e.key||e.shiftKey?void(oe&&("Delete"===e.key||"Backspace"===e.key?(e.preventDefault(),ne(e=>e.filter(e=>e.id!==oe)),ie(null)):"Escape"===e.key&&ie(null))):(e.preventDefault(),ne(e=>e.slice(0,-1)),void ie(null))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[oe]);const ze=e=>{const t=!{bold:A,italic:K,underline:X}[e];"bold"===e&&O(t),"italic"===e&&V(t),"underline"===e&&Z(t),oe&&ne(r=>r.map(r=>r.id===oe&&"text"===r.type?{...r,[e]:t}:r))},De=e=>{G(e),oe&&ne(t=>t.map(t=>t.id===oe&&"text"===t.type?{...t,borderColor:e}:t))},Ee=e=>{Y(e),oe&&ne(t=>t.map(t=>t.id===oe&&"text"===t.type?{...t,background:e}:t))},Pe=e=>{if(!ye)return;const t=e??ye.value;if(!t.trim())return ye.editingId&&ne(e=>e.filter(e=>e.id!==ye.editingId)),void xe(null);if(ye.editingId)ne(e=>e.map(e=>e.id===ye.editingId&&"text"===e.type?{...e,text:t}:e));else{const e={id:p(),type:"text",x:ye.x,y:ye.y,text:t,color:W,size:F,font:T,bold:A,italic:K,underline:X,borderColor:q,background:Q,padding:_};ne(t=>[...t,e]),ie(e.id),S("select")}xe(null)},$e=async()=>{const e=z.current,t=D.current;if(!e||!t||!ae)return null;const r=document.createElement("canvas");r.width=ae.w,r.height=ae.h;const n=r.getContext("2d");n.drawImage(e,0,0);const o=t.cloneNode(!0);o.querySelectorAll("[data-chrome]").forEach(e=>e.remove());const i=(new XMLSerializer).serializeToString(o),a=new Blob([i],{type:"image/svg+xml;charset=utf-8"}),l=URL.createObjectURL(a),s=new Image;return await new Promise(e=>{s.onload=()=>e(),s.onerror=()=>e(),s.src=l}),n.drawImage(s,0,0,ae.w,ae.h),URL.revokeObjectURL(l),r};l(N,()=>({save:async()=>{const t=await $e();t&&t.toBlob(t=>{if(!t)return void e.error($.current.exportFailed);const r=URL.createObjectURL(t),n=document.createElement("a");n.href=r;const o=y.replace(/\.[^.]+$/,"");n.download=`${o}-annotated.png`,n.click(),URL.revokeObjectURL(r)},"image/png")},copy:async()=>{if(!("clipboard"in navigator)||"undefined"==typeof ClipboardItem)return void e.error($.current.clipboardUnsupported);const t=await $e();t&&t.toBlob(async t=>{if(t)try{await navigator.clipboard.write([new ClipboardItem({"image/png":t})]),e.success($.current.copied)}catch{e.error($.current.copyRefused)}else e.error($.current.copyFailed)},"image/png")}}),[ae,y]);const Ie=i(()=>[{id:"select",label:P.toolSelect,icon:/* @__PURE__ */s("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */s("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 3l7 17 2-7 7-2L5 3z"})})},{id:"draw",label:P.toolDraw,icon:/* @__PURE__ */s("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */s("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L6.832 19.82a4.5 4.5 0 01-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 011.13-1.897L16.863 4.487z"})})},{id:"rect",label:P.toolRect,icon:/* @__PURE__ */s("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */s("rect",{x:"4",y:"6",width:"16",height:"12",rx:"3"})})},{id:"circle",label:P.toolEllipse,icon:/* @__PURE__ */s("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */s("ellipse",{cx:"12",cy:"12",rx:"8",ry:"6"})})},{id:"arrow",label:P.toolArrow,icon:/* @__PURE__ */s("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */s("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 19L19 5m0 0h-7m7 0v7"})})},{id:"mosaic",label:P.toolMosaic,icon:/* @__PURE__ */s("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */s("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 4h6v6H4zM14 4h6v6h-6zM4 14h6v6H4zM14 14h6v6h-6z"})})},{id:"text",label:P.toolText,icon:/* @__PURE__ */s("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */s("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M12 6v14M9 20h6"})})},{id:"crop",label:P.toolCrop,icon:/* @__PURE__ */s("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */s("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 2v15a1 1 0 001 1h15M2 6h15a1 1 0 011 1v15"})})}],[P]),Se=e=>"p-2 rounded transition-colors "+(e?"bg-blue-500 text-on-accent":"text-ink hover:bg-gray-200"),We=Me?.type??("select"===I?null:I),Be="rect"===We||"circle"===We||"arrow"===We||"draw"===We,Re="rect"===We,je="text"===We;/* @__PURE__ */
|
|
2
2
|
return c("div",{className:"flex flex-col h-full bg-gray-100",children:[
|
|
3
3
|
/* @__PURE__ */c("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-line bg-surface shrink-0 flex-wrap text-xs",children:[Ie.map(e=>/* @__PURE__ */s("button",{onClick:()=>{S(e.id),ie(null)},title:e.label,className:Se(I===e.id),children:e.icon},e.id)),
|
|
4
4
|
/* @__PURE__ */s("div",{className:"h-5 w-px bg-gray-300 mx-1"}),
|
|
5
5
|
/* @__PURE__ */s("div",{className:"flex items-center gap-1",children:h.map(e=>/* @__PURE__ */s("button",{onClick:()=>(e=>{B(e),oe&&ne(t=>t.map(t=>t.id!==oe||"mosaic"===t.type?t:{...t,color:e}))})(e),title:e,className:"h-5 w-5 rounded-full border "+(W===e?"ring-2 ring-blue-500 ring-offset-1":"border-gray-300"),style:{background:e}},e))}),Be&&/* @__PURE__ */c(d,{children:[
|
|
6
6
|
/* @__PURE__ */s("div",{className:"h-5 w-px bg-gray-300 mx-1"}),
|
|
7
7
|
/* @__PURE__ */c("label",{className:"flex items-center gap-2 text-gray-600",children:[
|
|
8
|
-
/* @__PURE__ */s("span",{children
|
|
8
|
+
/* @__PURE__ */s("span",{children:P.weight}),
|
|
9
9
|
/* @__PURE__ */s("input",{type:"range",min:1,max:20,step:1,value:R,onChange:e=>{return t=Number(e.target.value),j(t),void(oe&&ne(e=>e.map(e=>e.id!==oe?e:"rect"===e.type||"circle"===e.type||"arrow"===e.type||"draw"===e.type?{...e,stroke:t}:e)));var t},className:"w-16 accent-blue-500"}),
|
|
10
10
|
/* @__PURE__ */s("span",{className:"tabular-nums w-5 text-right",children:R})]})]}),Re&&/* @__PURE__ */c(d,{children:[
|
|
11
11
|
/* @__PURE__ */s("div",{className:"h-5 w-px bg-gray-300 mx-1"}),
|
|
12
12
|
/* @__PURE__ */c("label",{className:"flex items-center gap-2 text-gray-600",children:[
|
|
13
|
-
/* @__PURE__ */s("span",{children
|
|
13
|
+
/* @__PURE__ */s("span",{children:P.radius}),
|
|
14
14
|
/* @__PURE__ */s("input",{type:"range",min:0,max:48,step:1,value:ee,onChange:e=>{return t=Number(e.target.value),te(t),void(oe&&ne(e=>e.map(e=>e.id===oe&&"rect"===e.type?{...e,radius:t}:e)));var t},className:"w-16 accent-blue-500"}),
|
|
15
15
|
/* @__PURE__ */s("span",{className:"tabular-nums w-6 text-right",children:ee})]})]}),je&&/* @__PURE__ */c(d,{children:[
|
|
16
16
|
/* @__PURE__ */s("div",{className:"h-5 w-px bg-gray-300 mx-1"}),
|
|
17
|
-
/* @__PURE__ */s("select",{value:T,onChange:e=>{return t=e.target.value,
|
|
18
|
-
/* @__PURE__ */s("button",{onClick:()=>ze("bold"),className:Se(
|
|
19
|
-
/* @__PURE__ */s("button",{onClick:()=>ze("italic"),className:Se(K),title
|
|
20
|
-
/* @__PURE__ */s("button",{onClick:()=>ze("underline"),className:Se(X),title
|
|
17
|
+
/* @__PURE__ */s("select",{value:T,onChange:e=>{return t=e.target.value,U(t),void(oe&&ne(e=>e.map(e=>e.id===oe&&"text"===e.type?{...e,font:t}:e)));var t},className:"text-xs border border-gray-300 rounded px-1 py-0.5 bg-white",children:u.map(e=>/* @__PURE__ */s("option",{value:e.id,children:P[e.name]},e.id))}),
|
|
18
|
+
/* @__PURE__ */s("button",{onClick:()=>ze("bold"),className:Se(A),title:P.bold,children:/* @__PURE__ */s("span",{className:"font-bold",children:P.boldLetter})}),
|
|
19
|
+
/* @__PURE__ */s("button",{onClick:()=>ze("italic"),className:Se(K),title:P.italic,children:/* @__PURE__ */s("span",{className:"italic",children:P.italicLetter})}),
|
|
20
|
+
/* @__PURE__ */s("button",{onClick:()=>ze("underline"),className:Se(X),title:P.underline,children:/* @__PURE__ */s("span",{className:"underline",children:P.underlineLetter})}),
|
|
21
21
|
/* @__PURE__ */c("label",{className:"flex items-center gap-2 text-gray-600",children:[
|
|
22
|
-
/* @__PURE__ */s("span",{children
|
|
23
|
-
/* @__PURE__ */s("input",{type:"range",min:10,max:96,step:1,value:
|
|
24
|
-
/* @__PURE__ */s("span",{className:"tabular-nums w-7 text-right",children:
|
|
22
|
+
/* @__PURE__ */s("span",{children:P.size}),
|
|
23
|
+
/* @__PURE__ */s("input",{type:"range",min:10,max:96,step:1,value:F,onChange:e=>{return t=Number(e.target.value),H(t),void(oe&&ne(e=>e.map(e=>e.id===oe&&"text"===e.type?{...e,size:t}:e)));var t},className:"w-16 accent-blue-500"}),
|
|
24
|
+
/* @__PURE__ */s("span",{className:"tabular-nums w-7 text-right",children:F})]}),
|
|
25
25
|
/* @__PURE__ */c("label",{className:"flex items-center gap-1 text-gray-600",children:[
|
|
26
|
-
/* @__PURE__ */s("span",{children
|
|
27
|
-
/* @__PURE__ */s("input",{type:"color",value:
|
|
28
|
-
/* @__PURE__ */s("button",{onClick:()=>De(null),title
|
|
26
|
+
/* @__PURE__ */s("span",{children:P.border}),q?/* @__PURE__ */c(d,{children:[
|
|
27
|
+
/* @__PURE__ */s("input",{type:"color",value:q,onChange:e=>De(e.target.value),title:P.borderColor,className:"h-5 w-6 rounded border border-gray-300 bg-white p-0 cursor-pointer"}),
|
|
28
|
+
/* @__PURE__ */s("button",{onClick:()=>De(null),title:P.removeBorder,className:"px-0.5 text-gray-400 hover:text-gray-700",children:"✕"})]}):/* @__PURE__ */s("button",{onClick:()=>De(W),title:P.addBorder,className:"px-2 py-0.5 rounded border border-line-strong text-gray-600 hover:bg-gray-100",children:P.add})]}),
|
|
29
29
|
/* @__PURE__ */c("label",{className:"flex items-center gap-1 text-gray-600",children:[
|
|
30
|
-
/* @__PURE__ */s("span",{children
|
|
31
|
-
/* @__PURE__ */s("input",{type:"color",value:
|
|
32
|
-
/* @__PURE__ */s("button",{onClick:()=>
|
|
30
|
+
/* @__PURE__ */s("span",{children:P.fill}),Q?/* @__PURE__ */c(d,{children:[
|
|
31
|
+
/* @__PURE__ */s("input",{type:"color",value:Q,onChange:e=>Ee(e.target.value),title:P.fillColor,className:"h-5 w-6 rounded border border-gray-300 bg-white p-0 cursor-pointer"}),
|
|
32
|
+
/* @__PURE__ */s("button",{onClick:()=>Ee(null),title:P.removeFill,className:"px-0.5 text-gray-400 hover:text-gray-700",children:"✕"})]}):/* @__PURE__ */s("button",{onClick:()=>Ee("#ffffff"),title:P.addFill,className:"px-2 py-0.5 rounded border border-line-strong text-gray-600 hover:bg-gray-100",children:P.add})]}),
|
|
33
33
|
/* @__PURE__ */c("label",{className:"flex items-center gap-2 text-gray-600",children:[
|
|
34
|
-
/* @__PURE__ */s("span",{children
|
|
35
|
-
/* @__PURE__ */s("input",{type:"range",min:0,max:40,step:1,value:_,onChange:e=>{return t=Number(e.target.value),
|
|
34
|
+
/* @__PURE__ */s("span",{children:P.padding}),
|
|
35
|
+
/* @__PURE__ */s("input",{type:"range",min:0,max:40,step:1,value:_,onChange:e=>{return t=Number(e.target.value),J(t),void(oe&&ne(e=>e.map(e=>e.id===oe&&"text"===e.type?{...e,padding:t}:e)));var t},className:"w-14 accent-blue-500"}),
|
|
36
36
|
/* @__PURE__ */s("span",{className:"tabular-nums w-6 text-right",children:_})]})]}),
|
|
37
37
|
/* @__PURE__ */s("div",{className:"h-5 w-px bg-gray-300 mx-1"}),
|
|
38
|
-
/* @__PURE__ */s("button",{onClick:()=>he(e=>Math.max(.25,Math.round(100*(e-.25))/100)),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-700",title
|
|
38
|
+
/* @__PURE__ */s("button",{onClick:()=>he(e=>Math.max(.25,Math.round(100*(e-.25))/100)),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-700",title:P.zoomOut,children:"−"}),
|
|
39
39
|
/* @__PURE__ */c("span",{className:"text-gray-600 tabular-nums w-10 text-center",children:[Math.round(100*de),"%"]}),
|
|
40
|
-
/* @__PURE__ */s("button",{onClick:()=>he(e=>Math.min(4,Math.round(100*(e+.25))/100)),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-700",title
|
|
41
|
-
/* @__PURE__ */s("button",{onClick:()=>he(1),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-700",title
|
|
40
|
+
/* @__PURE__ */s("button",{onClick:()=>he(e=>Math.min(4,Math.round(100*(e+.25))/100)),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-700",title:P.zoomIn,children:"+"}),
|
|
41
|
+
/* @__PURE__ */s("button",{onClick:()=>he(1),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-700",title:P.fitHint,children:P.fit}),
|
|
42
42
|
/* @__PURE__ */s("div",{className:"h-5 w-px bg-gray-300 mx-1"}),
|
|
43
|
-
/* @__PURE__ */s("button",{onClick:()=>{ne(e=>e.slice(0,-1)),ie(null)},disabled:0===re.length,className:"px-2 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-700",children
|
|
43
|
+
/* @__PURE__ */s("button",{onClick:()=>{ne(e=>e.slice(0,-1)),ie(null)},disabled:0===re.length,className:"px-2 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-700",children:P.undo}),
|
|
44
44
|
/* @__PURE__ */c("div",{className:"ml-auto flex items-center gap-2",children:[me&&/* @__PURE__ */c(d,{children:[
|
|
45
|
-
/* @__PURE__ */s("button",{onClick:()=>{if(!me||!
|
|
46
|
-
/* @__PURE__ */s("button",{onClick:()=>ge(null),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-700",children
|
|
47
|
-
/* @__PURE__ */s("button",{onClick:async()=>{const t=await
|
|
45
|
+
/* @__PURE__ */s("button",{onClick:()=>{if(!me||!E.current||!ae)return;const e=me,t=document.createElement("canvas");t.width=Math.round(e.w),t.height=Math.round(e.h);const r=t.getContext("2d"),n=document.createElement("canvas");n.width=ae.w,n.height=ae.h;const o=n.getContext("2d");o.drawImage(E.current,0,0);for(const e of Ne)C(o,e);r.drawImage(n,e.x,e.y,e.w,e.h,0,0,e.w,e.h);const i=new Image;i.onload=()=>{E.current=i,le({w:i.naturalWidth,h:i.naturalHeight}),ne(t=>t.filter(e=>"mosaic"!==e.type).map(t=>b(t,-e.x,-e.y)).filter(e=>function(e,t,r){const n=k(e);return n.x+n.w>0&&n.y+n.h>0&&n.x<t&&n.y<r}(e,i.naturalWidth,i.naturalHeight))),ge(null)},i.src=t.toDataURL("image/png")},className:"px-2 py-1 rounded bg-blue-500 text-white hover:bg-blue-600",children:P.applyCrop}),
|
|
46
|
+
/* @__PURE__ */s("button",{onClick:()=>ge(null),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-700",children:P.cancel})]}),m&&!me&&/* @__PURE__ */c(d,{children:[g&&/* @__PURE__ */s("button",{onClick:g,className:"px-3 py-1 rounded hover:bg-gray-200 text-gray-700 text-xs font-medium",children:P.cancel}),
|
|
47
|
+
/* @__PURE__ */s("button",{onClick:async()=>{const t=await $e();t?t.toBlob(t=>{t?m(t):e.error($.current.exportFailed)},"image/png"):e.error($.current.exportFailed)},className:"px-3 py-1 rounded bg-blue-500 text-white hover:bg-blue-600 text-xs font-medium",children:P.apply})]})]})]}),
|
|
48
48
|
/* @__PURE__ */s("div",{ref:L,className:"flex-1 overflow-auto bg-gray-200 flex items-center justify-center p-4 relative",children:be&&ae&&/* @__PURE__ */c("div",{className:"relative shadow-lg rounded overflow-hidden bg-white shrink-0",style:{width:be.w,height:be.h},children:[
|
|
49
49
|
/* @__PURE__ */s("canvas",{ref:z,style:{position:"absolute",inset:0,width:"100%",height:"100%",display:"block"}}),
|
|
50
|
-
/* @__PURE__ */c("svg",{ref:D,viewBox:`0 0 ${ae.w} ${ae.h}`,preserveAspectRatio:"none",style:{position:"absolute",inset:0,width:"100%",height:"100%",touchAction:"none",cursor:"select"===I?"default":"text"===I?"text":"crosshair"},onPointerDown:e=>{if("select"===I)return void ie(null);if("text"===I){if(ye)return void
|
|
51
|
-
/* @__PURE__ */s("div",{className:"px-3 py-2 border-t border-line bg-surface text-2xs text-ink-faint shrink-0",children:"select"===I?oe
|
|
50
|
+
/* @__PURE__ */c("svg",{ref:D,viewBox:`0 0 ${ae.w} ${ae.h}`,preserveAspectRatio:"none",style:{position:"absolute",inset:0,width:"100%",height:"100%",touchAction:"none",cursor:"select"===I?"default":"text"===I?"text":"crosshair"},onPointerDown:e=>{if("select"===I)return void ie(null);if("text"===I){if(ye)return void Pe();const t=Ce(e);return void xe({x:t.x,y:t.y,value:""})}const t=Ce(e);if("crop"!==I){if("draw"===I)return Le({kind:"pen",points:[t]}),void pe({id:"",type:"draw",points:[t],color:W,stroke:R});pe(v(I,t,t,W,R,ee)),Le({kind:"draw",start:t})}else Le({kind:"crop",start:t})},children:[re.map(e=>/* @__PURE__ */s(x,{anno:e,selected:oe===e.id,zoom:de,onPointerDown:t=>((e,t)=>{"select"===I&&(e.stopPropagation(),ie(t.id),Le({kind:"move",id:t.id,start:Ce(e),original:t}))})(t,e),onDoubleClick:()=>{var t;"text"===(t=e).type&&xe({x:t.x,y:t.y,value:t.text,editingId:t.id})},onHandlePointerDown:(t,r)=>((e,t,r)=>{e.stopPropagation(),Le({kind:"resize",id:t.id,corner:r,start:Ce(e),original:t})})(t,e,r)},e.id)),ue&&/* @__PURE__ */s(x,{anno:{...ue,id:"__preview"},preview:!0}),me&&/* @__PURE__ */s(w,{rect:me,imageSize:ae})]}),ye&&/* @__PURE__ */s(f,{pendingText:ye,color:W,size:F,font:u.find(e=>e.id===T)?.css??u[0].css,bold:A,italic:K,underline:X,borderColor:q,background:Q,padding:_,scale:ke,onChange:e=>xe({...ye,value:e}),onCommit:Pe,onCancel:()=>xe(null)})]})}),
|
|
51
|
+
/* @__PURE__ */s("div",{className:"px-3 py-2 border-t border-line bg-surface text-2xs text-ink-faint shrink-0",children:"select"===I?oe?P.hintSelected:P.hintSelect:"text"===I?P.hintText:"crop"===I?P.hintCrop:"draw"===I?P.hintDraw:P.hintShape})]})});function x({anno:e,selected:t,preview:r,zoom:n=1,onPointerDown:o,onDoubleClick:i,onHandlePointerDown:a}){const l=k(e),h=o?{onPointerDown:o,pointerEvents:"all",style:{cursor:"move"}}:{},p=i?{onDoubleClick:i}:{};let y;if("rect"===e.type)y=/* @__PURE__ */s("rect",{x:e.x,y:e.y,width:e.w,height:e.h,rx:e.radius,ry:e.radius,fill:"none",stroke:e.color,strokeWidth:e.stroke,strokeLinecap:"round",strokeLinejoin:"round",...h});else if("circle"===e.type)y=/* @__PURE__ */s("ellipse",{cx:e.x+e.w/2,cy:e.y+e.h/2,rx:e.w/2,ry:e.h/2,fill:"none",stroke:e.color,strokeWidth:e.stroke,...h});else if("arrow"===e.type)y=/* @__PURE__ */s(g,{anno:e,interactive:h});else if("draw"===e.type)y=/* @__PURE__ */s("path",{d:N(e.points),fill:"none",stroke:e.color,strokeWidth:e.stroke,strokeLinecap:"round",strokeLinejoin:"round",...h});else if("mosaic"===e.type)y=/* @__PURE__ */s("rect",{x:e.x,y:e.y,width:e.w,height:e.h,fill:"rgba(0,0,0,0.001)",stroke:"none",strokeWidth:t?2:0,strokeDasharray:t?"6,4":void 0,...h,style:t?{...h.style,stroke:"var(--rosh-annotator-selection)"}:h.style});else{const t=u.find(t=>t.id===e.font)?.css??u[0].css,r=e.padding??0,n=!!e.borderColor||!!e.background,o=k(e),i=e.borderColor?Math.max(1,Math.round(e.size/12)):0;y=/* @__PURE__ */c("g",{...h,...p,children:[n&&/* @__PURE__ */s("rect",{x:o.x-r,y:o.y-r,width:Math.max(0,o.w)+2*r,height:Math.max(0,o.h)+2*r,rx:Math.min(8,r),ry:Math.min(8,r),fill:e.background??"none",stroke:e.borderColor??"none",strokeWidth:i}),
|
|
52
52
|
/* @__PURE__ */s("text",{x:e.x,y:e.y+e.size,fill:e.color,fontSize:e.size,fontWeight:e.bold?700:400,fontStyle:e.italic?"italic":"normal",textDecoration:e.underline?"underline":void 0,fontFamily:t,style:{userSelect:"none"},children:e.text.split("\n").map((t,r)=>/* @__PURE__ */s("tspan",{x:e.x,dy:0===r?0:1.2*e.size,children:t},r))})]})}/* @__PURE__ */
|
|
53
53
|
return c("g",{children:[y,t&&!r&&/* @__PURE__ */c(d,{children:[
|
|
54
54
|
/* @__PURE__ */s("rect",{"data-chrome":"selection",x:l.x-4,y:l.y-4,width:l.w+8,height:l.h+8,fill:"none",strokeWidth:2/n,strokeDasharray:`${6/n},${4/n}`,pointerEvents:"none",style:{stroke:"var(--rosh-annotator-selection)"}}),a&&/* @__PURE__ */s(m,{anno:e,zoom:n,onHandlePointerDown:a})]})]})}function m({anno:e,zoom:t,onHandlePointerDown:r}){const n=6/t,o=1.5/t,i=e=>({fill:"white",strokeWidth:o,pointerEvents:"all",style:{cursor:e,stroke:"var(--rosh-annotator-selection)"},"data-chrome":"handle"});if("arrow"===e.type)/* @__PURE__ */
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Tooltip as e}from"./chunk-SOZCWT6I.js";import{Fragment as r}from"react";import{jsx as l,jsxs as a}from"react/jsx-runtime";var i="58px",t="--picture-tiles-columns";function o(e){let r=0;for(const l of e)for(const e of l.label.split(/\s+/))r=Math.max(r,[...e].length);return r}function s({options:t,value:s,onChange:n,onClear:c,columns:u,captions:p=!1,label:d,className:b="","aria-labelledby":m}){const f=p?{"--picture-tiles-min":i,"--picture-tiles-longest-word":o(t),...u?{"--picture-tiles-default-columns":u}:{}}:{gridTemplateColumns:u?`repeat(${u}, minmax(0, 1fr))`:`repeat(auto-fill, minmax(${i}, 1fr))`};/* @__PURE__ */
|
|
2
|
+
return l("div",{role:"group","aria-label":m?void 0:d,"aria-labelledby":m,style:f,className:`${p?"rosh-picture-tiles"+(u?"":" rosh-picture-tiles-fit"):"grid"} gap-(--space-8) ${b}`.replace(/\s+/g," ").trim(),children:t.map(i=>{const t=i.value===s,o=/* @__PURE__ */a("button",{type:"button","aria-pressed":t,"aria-label":p?void 0:i.label,disabled:i.disabled||void 0,onClick:()=>{t?c?.():n(i.value)},className:`flex w-full min-w-0 flex-col items-center justify-center gap-(--space-4) rounded-(--radius-control) border transition-colors rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-strong)] disabled:cursor-not-allowed disabled:opacity-50 ${p?"px-(--space-4) py-(--space-8)":"p-(--space-4)"} ${t?"border-blue-600 bg-surface text-blue-600 ring-2 ring-blue-400/40":"border-line bg-surface text-ink-faint hover:bg-row-hover hover:text-ink"}`,children:[i.picture,p&&/* @__PURE__ */l("span",{className:"max-w-full text-center text-2xs leading-4 break-normal",children:i.label})]});return p?/* @__PURE__ */l(r,{children:o},i.value):/* @__PURE__ */l(e,{content:i.label,describe:!1,className:"relative flex min-w-0",children:o},i.value)})})}export{t as PICTURE_TILES_COLUMNS_VAR,s as PictureTiles};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Tooltip as r}from"./chunk-SOZCWT6I.js";import{useShellStrings as e}from"./chunk-
|
|
1
|
+
import{Tooltip as r}from"./chunk-SOZCWT6I.js";import{useShellStrings as e}from"./chunk-L6XEON5Q.js";import{jsx as t,jsxs as n}from"react/jsx-runtime";var i="Alt+ArrowUp Alt+ArrowDown";function c(r){return!r.altKey||r.ctrlKey||r.metaKey?null:"ArrowUp"===r.key?"up":"ArrowDown"===r.key?"down":null}var a=/* @__PURE__ */n("svg",{"aria-hidden":"true",viewBox:"0 0 4 14",fill:"currentColor",className:"h-3.5 w-1",children:[
|
|
2
2
|
/* @__PURE__ */t("circle",{cx:"2",cy:"3",r:"1.1"}),
|
|
3
3
|
/* @__PURE__ */t("circle",{cx:"2",cy:"7",r:"1.1"}),
|
|
4
4
|
/* @__PURE__ */t("circle",{cx:"2",cy:"11",r:"1.1"})]});function l({hint:n,dragging:i,revealClassName:c,marker:l}){const o=e().tree;/* @__PURE__ */
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Tooltip as e}from"./chunk-SOZCWT6I.js";import{useBrowserLayoutEffect as r}from"./chunk-D65T4H6J.js";import{useShellStrings as t}from"./chunk-
|
|
2
|
-
return s(e,{content:z??
|
|
1
|
+
import{Tooltip as e}from"./chunk-SOZCWT6I.js";import{useBrowserLayoutEffect as r}from"./chunk-D65T4H6J.js";import{useShellStrings as t}from"./chunk-L6XEON5Q.js";import{useRef as o,useEffect as n,useCallback as i}from"react";import{jsx as s}from"react/jsx-runtime";var a=(e,r,t)=>Math.min(t,Math.max(r,e));function l(e,r,t,o,n){return Math.round(a("left"===t||"top"===t?e+r:e-r,o,n))}function u(e,r,t){let o=null;try{o=window.localStorage.getItem(e)}catch{return null}const n=o?parseInt(o,10):NaN;return Number.isNaN(n)?null:a(n,r,t)}function c({width:c,onResize:d,orientation:h="vertical",side:m,min:f,max:p,defaultWidth:v=f,step:g=16,storageKey:b,label:w,hint:z,controls:y,className:x=""}){const N="horizontal"===h,P=t().resizeHandle,k=o(null),C=o({onResize:d,min:f,max:p,side:m});C.current={onResize:d,min:f,max:p,side:m},r(()=>{if(!b)return;const e=u(b,f,p);null!==e&&e!==c&&d(e)},[b]),n(()=>{if(!b)return;const e=window.setTimeout(()=>{try{window.localStorage.setItem(b,String(Math.round(c)))}catch{}},200);return()=>window.clearTimeout(e)},[c,b]);const D=i(()=>{k.current=null,document.body.style.removeProperty("cursor"),document.body.style.removeProperty("user-select")},[]);n(()=>D,[D]);const I=e=>{k.current&&(e.currentTarget.hasPointerCapture?.(k.current.pointer)&&e.currentTarget.releasePointerCapture(k.current.pointer),D())},M="left"===m?"right-0":"right"===m?"left-0":"top"===m?"bottom-0":"top-0",T="left"===m?"right":"right"===m?"left":"top"===m?"bottom":"top",$=N?`absolute inset-x-0 ${M} z-10 flex h-2`:`absolute inset-y-0 ${M} z-10 flex w-2`;/* @__PURE__ */
|
|
2
|
+
return s(e,{content:z??P.hint,side:T,delay:600,className:`${$} ${x}`.trim(),children:/* @__PURE__ */s("div",{role:"separator",tabIndex:0,"aria-orientation":h,"aria-label":w??P.label,"aria-valuenow":Math.round(c),"aria-valuemin":f,"aria-valuemax":p,"aria-controls":y,"data-resize-handle":m,onPointerDown:e=>{0===e.button&&(e.preventDefault(),k.current={x:N?e.clientY:e.clientX,width:c,moved:!1,pointer:e.pointerId},e.currentTarget.setPointerCapture?.(e.pointerId),document.body.style.cursor=N?"row-resize":"col-resize",document.body.style.userSelect="none")},onPointerMove:e=>{const r=k.current;if(!r)return;if(0===e.buttons)return void D();const t=(N?e.clientY:e.clientX)-r.x;if(!r.moved){if(Math.abs(t)<3)return;r.moved=!0}const{onResize:o,min:n,max:i,side:s}=C.current;o(l(r.width,t,s,n,i))},onPointerUp:I,onPointerCancel:I,onLostPointerCapture:()=>{k.current&&D()},onDoubleClick:()=>d(a(v,f,p)),onKeyDown:e=>{const r=N?"ArrowDown":"ArrowRight",t=N?"ArrowUp":"ArrowLeft",o=e.key===r?g:e.key===t?-g:null,n=null!==o?l(c,o,m,f,p):"Home"===e.key?f:"End"===e.key?p:"Enter"===e.key?a(v,f,p):null;null!==n&&(e.preventDefault(),n!==c&&d(n))},className:N?"group/resize relative h-full w-full cursor-row-resize touch-none rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring-solid)]":"group/resize relative h-full w-full cursor-col-resize touch-none rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */s("div",{"aria-hidden":"true",className:N?`absolute inset-x-0 ${M} h-px bg-transparent transition-colors group-hover/resize:bg-[var(--accent-500,var(--rosh-resize-handle))] group-focus-visible/resize:h-0.5 group-focus-visible/resize:bg-[var(--accent-500,var(--rosh-resize-handle))]`:`absolute inset-y-0 ${M} w-px bg-transparent transition-colors group-hover/resize:bg-[var(--accent-500,var(--rosh-resize-handle))] group-focus-visible/resize:w-0.5 group-focus-visible/resize:bg-[var(--accent-500,var(--rosh-resize-handle))]`})})})}export{c as ResizeHandle,u as readStoredWidth,l as resizedWidth};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Modal as e}from"./chunk-
|
|
1
|
+
import{Modal as e}from"./chunk-VW3ZUWW2.js";import{keepsNativeMenu as a}from"./chunk-5QFPTDQF.js";import{jsx as i,jsxs as n}from"react/jsx-runtime";var t={activeOpacity:70,inactiveOpacity:50,activeBlur:0,inactiveBlur:0};function r(e){try{const a=JSON.parse(localStorage.getItem(e)||"");return null!=a.blur&&null==a.activeBlur&&(a.activeBlur=a.blur,a.inactiveBlur=a.blur,delete a.blur),{...t,...a}}catch{return t}}function l({open:t,onClose:r,title:l,appearance:c,onAppearanceChange:s,onSave:d,children:o}){if(!t)return null;const u="w-full h-1.5 rounded-full appearance-none bg-gray-200 cursor-pointer accent-blue-500",p="flex items-center justify-between text-xs text-gray-500";/* @__PURE__ */
|
|
2
2
|
return i("div",{onPointerDown:e=>e.stopPropagation(),onContextMenu:e=>{e.stopPropagation(),a(e.target)||e.preventDefault()},children:/* @__PURE__ */i(e,{open:t,onClose:r,title:l,size:"sm",children:/* @__PURE__ */n("div",{className:"space-y-4",children:[o,
|
|
3
3
|
/* @__PURE__ */n("div",{children:[
|
|
4
4
|
/* @__PURE__ */i("h3",{className:"text-sm font-semibold text-gray-700 mb-3",children:"Appearance"}),
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{usePlotWidth as e}from"./chunk-MAFUXCPZ.js";import{ChartTooltip as t}from"./chunk-WDQI3FV6.js";import{resolveSeriesColor as l,CHART_INK as r}from"./chunk-TZFACUMR.js";import{registerModalEscapeInterceptor as n}from"./chunk-TWVUQUUD.js";import{useShellStrings as i,useShellLocale as a}from"./chunk-
|
|
2
|
-
return f("div",{className:k,ref:F,children:/* @__PURE__ */f("p",{className:"py-8 text-center text-sm text-gray-500",children:D})});const
|
|
1
|
+
import{usePlotWidth as e}from"./chunk-MAFUXCPZ.js";import{ChartTooltip as t}from"./chunk-WDQI3FV6.js";import{resolveSeriesColor as l,CHART_INK as r}from"./chunk-TZFACUMR.js";import{registerModalEscapeInterceptor as n}from"./chunk-TWVUQUUD.js";import{useShellStrings as i,useShellLocale as a}from"./chunk-L6XEON5Q.js";import{formatPlain as o}from"./chunk-C3QOHMR6.js";import{useRef as h,useId as c,useState as s,useEffect as m}from"react";import{jsx as f,jsxs as u}from"react/jsx-runtime";function x({rows:x,columns:d,cells:p,height:M,width:g,color:y,max:v,formatValue:$,label:b,className:k,emptyLabel:w,cellGap:A=2,cellRadius:N=2}){const j=i().charts,U=a(),z=$??(e=>o(e,U)),C=b??j.intensity,D=w??j.noActivity,F=h(null),L=e(F),Q=g??L,R=c(),[S,V]=s(null);if(m(()=>{if(null!==S)return n(e=>"Escape"===e.key&&(V(null),!0))},[S]),0===x.length||0===d.length)/* @__PURE__ */
|
|
2
|
+
return f("div",{className:k,ref:F,children:/* @__PURE__ */f("p",{className:"py-8 text-center text-sm text-gray-500",children:D})});const E=y??l(0),B=v??Math.max(1,...p.flat().filter(Number.isFinite)),G=96,I=26*x.length,O=M??I+26+26,T=Math.max(2,(Math.max(97,Q)-G)/d.length),W=e=>{const t=B>0?Math.max(0,Math.min(1,e/B)):0;return`color-mix(in oklab, ${E} ${(8+92*t).toFixed(1)}%, ${r.surface})`};/* @__PURE__ */
|
|
3
3
|
return u("div",{className:`relative ${k??""}`,ref:F,children:[
|
|
4
|
-
/* @__PURE__ */u("svg",{width:"100%",height:
|
|
5
|
-
/* @__PURE__ */f("defs",{children:/* @__PURE__ */u("linearGradient",{id:
|
|
6
|
-
/* @__PURE__ */f("stop",{offset:"0",stopColor:
|
|
7
|
-
/* @__PURE__ */f("stop",{offset:"1",stopColor:
|
|
8
|
-
return f("rect",{x:
|
|
9
|
-
/* @__PURE__ */f("rect",{x:
|
|
10
|
-
/* @__PURE__ */f("text",{x:
|
|
11
|
-
/* @__PURE__ */f("text",{x:
|
|
4
|
+
/* @__PURE__ */u("svg",{width:"100%",height:O,viewBox:`0 0 ${Q} ${O}`,role:"img","aria-label":j.heatmap(C,x.length,d.length),tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>V(null),onBlur:()=>V(null),onKeyDown:e=>{const t="ArrowDown"===e.key?1:"ArrowUp"===e.key?-1:0,l="ArrowRight"===e.key?1:"ArrowLeft"===e.key?-1:0;0===t&&0===l||(e.preventDefault(),V(e=>({r:Math.min(x.length-1,Math.max(0,(e?.r??0)+t)),c:Math.min(d.length-1,Math.max(0,(e?.c??0)+l))})))},children:[
|
|
5
|
+
/* @__PURE__ */f("defs",{children:/* @__PURE__ */u("linearGradient",{id:R,x1:"0",x2:"1",children:[
|
|
6
|
+
/* @__PURE__ */f("stop",{offset:"0",stopColor:W(0)}),
|
|
7
|
+
/* @__PURE__ */f("stop",{offset:"1",stopColor:W(B)})]})}),x.map((e,t)=>/* @__PURE__ */f("text",{x:86,y:26*t+13+4,textAnchor:"end",fontSize:11,fill:r.label,children:e},`r${t}`)),x.map((e,t)=>d.map((l,r)=>{const n=p[t]?.[r]??0,i=S&&(S.r!==t||S.c!==r);/* @__PURE__ */
|
|
8
|
+
return f("rect",{x:G+r*T+A/2,y:26*t+A/2,width:Math.max(1,T-A),height:26-A,rx:N,fill:W(n),opacity:i?.55:1,onMouseEnter:()=>V({r:t,c:r}),children:/* @__PURE__ */f("title",{children:`${e} · ${l}: ${z(n)}`})},`${t}-${r}`)})),d.map((e,t)=>t%Math.max(1,Math.ceil(d.length/Math.max(1,Math.floor((Q-G)/56))))===0?/* @__PURE__ */f("text",{x:G+t*T+T/2,y:I+15,textAnchor:"middle",fontSize:11,fill:r.label,children:e},`c${t}`):null),
|
|
9
|
+
/* @__PURE__ */f("rect",{x:G,y:I+26,width:Math.min(180,Math.max(40,Q-G)),height:8,rx:4,fill:`url(#${R})`}),
|
|
10
|
+
/* @__PURE__ */f("text",{x:G,y:I+48,fontSize:11,fill:r.label,children:"0"}),
|
|
11
|
+
/* @__PURE__ */f("text",{x:G+Math.min(180,Math.max(40,Q-G)),y:I+48,textAnchor:"end",fontSize:11,fill:r.label,style:{fontVariantNumeric:"tabular-nums"},children:z(B)})]}),S&&/* @__PURE__ */f("div",{className:"pointer-events-none absolute top-1 right-1 z-10",children:/* @__PURE__ */f(t,{title:`${x[S.r]} · ${d[S.c]}`,rows:[{key:"v",label:C,color:E,value:null==p[S.r]?.[S.c]?void 0:z(p[S.r][S.c])}]})})]})}export{x as HeatmapChart};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import{CountBadge as e}from"./chunk-
|
|
1
|
+
import{CountBadge as e}from"./chunk-XR7SPONC.js";import{SettingRowNameContext as i,SettingAutoContext as n}from"./chunk-2NMW66P5.js";import{isShown as a}from"./chunk-HCP7WOAL.js";import{useShellStrings as t}from"./chunk-L6XEON5Q.js";import{isValidElement as l}from"react";import{jsx as s,jsxs as r,Fragment as d}from"react/jsx-runtime";var c={pad:"p-4",gap:"gap-4",text:"text-sm",bodyTop:"mt-4",bodyPad:"pt-3"},m=e=>Array.isArray(e)?e.some(m):l(e);function o({label:l,icon:o,action:h,value:u,readout:f,changed:p=!1,description:x,children:N,controlId:v,labelId:g,unknownText:b="—",quiet:y=!1,size:k="default",viewState:w,divider:$=!0,showWhen:j,values:P,context:A,className:O=""}){const T=t();if(!a(j,P,A))return null;const W="auto"===w?/* @__PURE__ */s("span",{"data-setting-auto":"","aria-hidden":"true",className:"shrink-0 rounded-sm border border-line px-1 text-2xs font-normal leading-4 text-ink-faint",children:T.settingView.auto}):"edited"===w?/* @__PURE__ */r("span",{"data-setting-edited":"",className:"inline-flex shrink-0 items-center",children:[
|
|
2
2
|
/* @__PURE__ */s("span",{"aria-hidden":"true",className:"inline-flex",children:/* @__PURE__ */s(e,{dot:!0,tone:"accent"})}),
|
|
3
|
-
/* @__PURE__ */s("span",{className:"sr-only",children:
|
|
4
|
-
/* @__PURE__ */s("span",{className:"es-field-label",id:t,children:l}),
|
|
3
|
+
/* @__PURE__ */s("span",{className:"sr-only",children:T.settingView.edited})]}):null,C=null!=f&&!1!==f;if("compact"===k){const e=m(u),a=m(h);if(!e&&!a)return null;const t=g,c=["es-field"];e||c.push("is-inline"),p&&c.push("is-changed"),O&&c.push(O);const b=/* @__PURE__ */r(d,{children:[null!=o&&/* @__PURE__ */s("span",{className:"es-field-icon","aria-hidden":"true",children:o}),
|
|
4
|
+
/* @__PURE__ */s("span",{className:"es-field-label",id:t,children:l}),W]}),y=e=>/* @__PURE__ */s(i.Provider,{value:t,children:/* @__PURE__ */s(n.Provider,{value:"auto"===w,children:e})});/* @__PURE__ */
|
|
5
5
|
return r("div",{className:c.join(" "),children:[
|
|
6
|
-
/* @__PURE__ */r("div",{className:"es-field-head",children:[v?/* @__PURE__ */s("label",{className:"es-field-name",htmlFor:v,children:b}):/* @__PURE__ */s("span",{className:"es-field-name",children:b}),
|
|
7
|
-
return r("div",
|
|
6
|
+
/* @__PURE__ */r("div",{className:"es-field-head",children:[v?/* @__PURE__ */s("label",{className:"es-field-name",htmlFor:v,children:b}):/* @__PURE__ */s("span",{className:"es-field-name",children:b}),C&&/* @__PURE__ */s("span",{className:"es-field-value",children:f}),a&&y(h)]}),e&&/* @__PURE__ */s("div",{className:"es-field-ctl",children:y(u)}),x?/* @__PURE__ */s("p",{className:"es-field-hint",children:x}):null,N]})}const F=c,I=void 0!==u||void 0===N&&null==h,L=null==u||""===u,S=y?"text-gray-500":"text-gray-800",V=L?"text-gray-400":y?"text-gray-500":"text-gray-900",X=`${F.text} font-medium ${S}`,q=v?/* @__PURE__ */s("label",{htmlFor:v,id:g,className:X,children:l}):/* @__PURE__ */s("span",{id:g,className:X,children:l}),z=/* @__PURE__ */s(i.Provider,{value:g,children:/* @__PURE__ */s(n.Provider,{value:"auto"===w,children:L?b:u})}),B=[$?"border-t border-line-subtle first:border-t-0":"",F.pad,O].filter(Boolean).join(" "),E=null!=N&&!1!==N&&/* @__PURE__ */s("div",{className:`${F.bodyTop} border-t border-line-subtle ${F.bodyPad}`,children:N});/* @__PURE__ */
|
|
7
|
+
return r("div",C?{className:B,children:[
|
|
8
8
|
/* @__PURE__ */r("div",{"data-setting-line":"",className:"flex flex-wrap items-center justify-between gap-x-2 gap-y-2",children:[
|
|
9
|
-
/* @__PURE__ */s("div",{className:"flex-1 basis-0",children:/* @__PURE__ */r("div",{className:`flex min-w-0 items-center gap-2 ${
|
|
9
|
+
/* @__PURE__ */s("div",{className:"flex-1 basis-0",children:/* @__PURE__ */r("div",{className:`flex min-w-0 items-center gap-2 ${S}`,children:[null!=o&&/* @__PURE__ */s("span",{"aria-hidden":"true",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center",children:o}),q,W]})}),
|
|
10
10
|
/* @__PURE__ */r("div",{"data-setting-end":"",className:"ml-auto flex shrink-0 items-center gap-1",children:[
|
|
11
|
-
/* @__PURE__ */s("span",{"data-setting-readout":"",className:`whitespace-nowrap ${
|
|
12
|
-
/* @__PURE__ */r("div",{className:`flex items-center justify-between ${
|
|
11
|
+
/* @__PURE__ */s("span",{"data-setting-readout":"",className:`whitespace-nowrap ${F.text} ${y?"text-ink-faint":"text-ink-strongest"}`,children:f}),null!=h&&/* @__PURE__ */s("span",{"data-setting-reset":"",className:"inline-flex h-6 w-6 shrink-0 items-center justify-center",children:h})]})]}),x&&/* @__PURE__ */s("p",{className:"mt-0.5 text-xs text-ink-faint",children:x}),void 0!==u&&/* @__PURE__ */s("div",{"data-setting-value":"",className:`mt-2 flex justify-end ${F.text} ${V}`,children:z}),E]}:{className:B,children:[
|
|
12
|
+
/* @__PURE__ */r("div",{className:`flex items-center justify-between ${F.gap}`,children:[
|
|
13
13
|
/* @__PURE__ */r("div",{className:"min-w-0 flex-1",children:[null!=o?
|
|
14
|
-
/* @__PURE__ */r("div",{className:`flex min-w-0 items-center gap-2 ${
|
|
15
|
-
/* @__PURE__ */s("span",{"aria-hidden":"true",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center",children:o}),q,
|
|
14
|
+
/* @__PURE__ */r("div",{className:`flex min-w-0 items-center gap-2 ${S}`,children:[
|
|
15
|
+
/* @__PURE__ */s("span",{"aria-hidden":"true",className:"inline-flex h-4 w-4 shrink-0 items-center justify-center",children:o}),q,W]}):W?/* @__PURE__ */r("div",{className:"flex min-w-0 items-center gap-2",children:[q,W]}):q,x&&/* @__PURE__ */s("p",{className:"mt-0.5 text-xs text-ink-faint",children:x})]}),null!=h?/* @__PURE__ */r("div",{className:"ml-auto flex shrink-0 items-center gap-1",children:[I&&/* @__PURE__ */s("div",{className:`${F.text} ${V}`,children:z}),h]}):I&&/* @__PURE__ */s("div",{className:`shrink-0 ${F.text} ${V}`,children:z})]}),E]})}export{o as SettingRow};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import{useHighlight as e}from"./chunk-CNYAHYE6.js";import{usePlotWidth as t}from"./chunk-MAFUXCPZ.js";import{ChartTooltip as l}from"./chunk-WDQI3FV6.js";import{resolveSeriesColor as a,CHART_INK as n,STATUS_VARS as r}from"./chunk-TZFACUMR.js";import{useShellStrings as o,useShellLocale as i}from"./chunk-L6XEON5Q.js";import{formatPercent as u,formatPlain as h}from"./chunk-C3QOHMR6.js";import{useId as c,useState as m,useRef as s}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";function x({stages:x,shape:v="funnel",height:p,width:$,gap:g=4,minBandWidth:M=0,formatValue:y,color:b,className:k,emptyLabel:N}){const A=o().charts,L=i(),S=y??(e=>h(e,L)),j=N??A.noStages,z=c(),[V,F]=m(null),{highlighted:W}=e(),w=s(null),C=t(w,560),E=$??C;if(0===x.length)/* @__PURE__ */return d("p",{className:`text-sm text-gray-500 ${k??""}`,children:j});const Z=b??a(0),H=p??54*x.length,Q=Math.max(...x.map(e=>e.value),1),B="bars"===v,O=B?Math.round(Math.min(132,Math.max(80,.24*E))):Math.round(Math.min(168,Math.max(104,.38*E))),R=e=>{const t=x[e-1]?.value;return null!=t&&t>0?100*(1-x[e].value/t):null},U=e=>{const t=R(e);return{count:S(x[e].value),drop:null!=t?`−${u(t,1,L)}`:""}},X=B?Math.ceil(Math.max(...x.map((e,t)=>{const{count:l,drop:a}=U(t);return.62*(l.length+(a?a.length+1:0))*12}))+16):0,Y=E-O-X,D=Math.max(B?2:0,Math.min(M,Y)),I=e=>Math.max(D,Y*Math.max(0,e/Q)),P=e=>I(e)/2,T=O+Y/2,q=e=>46+e/Math.max(1,x.length-1)*54,G=e=>`color-mix(in oklab, ${Z} ${q(e).toFixed(0)}%, ${n.surface})`,J=e=>q(e)>=55?n.surface:n.label,K=(e,t)=>null!==V?V!==e:null!==W&&W!==t,_=null!==V?x[V]:void 0;/* @__PURE__ */
|
|
2
|
+
return f("div",{className:`relative ${k??""}`,ref:w,children:[
|
|
3
|
+
/* @__PURE__ */f("svg",{width:"100%",height:H,viewBox:`0 0 ${E} ${H}`,role:"img","aria-labelledby":z,onMouseLeave:()=>F(null),children:[
|
|
4
|
+
/* @__PURE__ */d("title",{id:z,children:A.funnel(x.length,S(x[0].value),S(x[x.length-1].value))}),x.map((e,t)=>{const l=t*H/x.length+g/2,a=(t+1)*H/x.length-g/2,r=(l+a)/2,o=u(e.value/(x[0].value||1)*100,0,L),i=.62*o.length*12+12;if(B){const u=O,h=u+I(e.value),{count:c,drop:m}=U(t);/* @__PURE__ */
|
|
5
|
+
return f("g",{opacity:K(t,e.key)?.45:1,onMouseEnter:()=>F(t),children:[
|
|
6
|
+
/* @__PURE__ */d("path",{d:`M${u},${l} L${h},${l} L${h},${a} L${u},${a} Z`,fill:G(t)}),
|
|
7
|
+
/* @__PURE__ */d("text",{x:O-12,y:r+4,textAnchor:"end",fontSize:12,fill:n.label,children:e.label}),h-u>=i&&/* @__PURE__ */d("text",{x:u+8,y:r+4,textAnchor:"start",fontSize:12,fontWeight:600,fill:J(t),style:{fontVariantNumeric:"tabular-nums"},children:o}),
|
|
8
|
+
/* @__PURE__ */f("text",{"data-funnel-value":"true",x:h+8,y:r+4,textAnchor:"start",fontSize:12,fill:n.label,style:{fontVariantNumeric:"tabular-nums"},children:[
|
|
9
|
+
/* @__PURE__ */d("tspan",{fontWeight:600,children:c}),m&&/* @__PURE__ */d("tspan",{fill:n.muted,children:` ${m}`})]})]},e.key)}const h=P(e.value),c="cone"===v?P(x[t+1]?.value??e.value):h,m=R(t),s=2*Math.min(h,c)>=i;/* @__PURE__ */
|
|
10
|
+
return f("g",{opacity:K(t,e.key)?.45:1,onMouseEnter:()=>F(t),children:[
|
|
11
|
+
/* @__PURE__ */d("path",{d:`M${T-h},${l} L${T+h},${l} L${T+c},${a} L${T-c},${a} Z`,fill:G(t)}),
|
|
12
|
+
/* @__PURE__ */d("text",{x:O-14,y:r-2,textAnchor:"end",fontSize:12,fill:n.label,children:e.label}),
|
|
13
|
+
/* @__PURE__ */f("text",{x:O-14,y:r+14,textAnchor:"end",fontSize:11,fill:n.muted,style:{fontVariantNumeric:"tabular-nums"},children:[S(e.value),null!=m?` · −${u(m,1,L)}`:""]}),
|
|
14
|
+
/* @__PURE__ */d("text",{x:s?T:T+Math.max(h,c)+6,y:r+4,textAnchor:s?"middle":"start",fontSize:12,fontWeight:600,fill:s?J(t):n.label,style:{fontVariantNumeric:"tabular-nums"},children:o})]},e.key)})]}),_&&null!==V&&/* @__PURE__ */d("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */d(l,{title:_.label,rows:[{key:"value",label:A.count,color:G(V),value:S(_.value)},{key:"share",label:A.ofFirstStage,color:n.muted,value:u(_.value/(x[0].value||1)*100,0,L)},...V>0&&x[V-1].value>0?[{key:"drop",label:A.droppedHere,color:r.critical,value:`−${u(100*(1-_.value/x[V-1].value),1,L)}`}]:[]]})})]})}export{x as FunnelChart};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{areaBetween as e,curvePath as i}from"./chunk-VFC6QUEN.js";import{CartesianPlot as l}from"./chunk-
|
|
2
|
-
return s(l,{labels:d,values:W,height:k,width:g,max:b,min:x,formatValue:
|
|
1
|
+
import{areaBetween as e,curvePath as i}from"./chunk-VFC6QUEN.js";import{CartesianPlot as l}from"./chunk-ADNUV6OV.js";import{ChartTooltip as t}from"./chunk-WDQI3FV6.js";import{resolveSeriesColor as r,CHART_INK as a}from"./chunk-TZFACUMR.js";import{useShellStrings as o,useShellLocale as n}from"./chunk-L6XEON5Q.js";import{formatPlain as h}from"./chunk-C3QOHMR6.js";import{jsx as s,jsxs as m,Fragment as c}from"react/jsx-runtime";function u({rows:u,labels:d,variant:p="area",curve:f="linear",height:k=220,width:g,max:b,min:x,formatValue:w,yAxisLabel:y,color:j,tone:L,label:v,className:N,emptyLabel:O,radius:V=3}){const M=o().charts,A=n(),F=w??(e=>h(e,A)),Q=v??M.range,W=u.flatMap(e=>[e.low,e.high]).filter(Number.isFinite),C=r(0,j,L);/* @__PURE__ */
|
|
2
|
+
return s(l,{labels:d,values:W,height:k,width:g,max:b,min:x,formatValue:F,yAxisLabel:y,className:N,emptyLabel:O,bandPadding:"bar"===p?.34:0,ariaLabel:M.rangeLabel(Q,d.length),tooltip:e=>/* @__PURE__ */s(t,{title:d[e],rows:[{key:"high",label:M.high,color:C,value:null==u[e]?void 0:F(u[e].high)},{key:"low",label:M.low,color:C,value:null==u[e]?void 0:F(u[e].low)}]}),children:({x:l,y:t,active:r})=>"bar"===p?/* @__PURE__ */s("g",{children:u.map((e,i)=>/* @__PURE__ */s("rect",{x:l(i),y:t(e.high),width:Math.max(1,l.bandwidth),height:Math.max(1,t(e.low)-t(e.high)),rx:V,fill:C,fillOpacity:null===r||r===i?.85:.4},i))}):/* @__PURE__ */m("g",{children:[(()=>{const r=u.map((e,i)=>[l.center(i),t(e.high)]),a=u.map((e,i)=>[l.center(i),t(e.low)]);/* @__PURE__ */
|
|
3
3
|
return m(c,{children:[
|
|
4
4
|
/* @__PURE__ */s("path",{d:e(i(r,f),a),fill:C,fillOpacity:.2,stroke:"none"}),
|
|
5
5
|
/* @__PURE__ */s("path",{d:i(r,f),fill:"none",stroke:C,strokeWidth:2,strokeLinejoin:"round"}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useShellLocale as e}from"./chunk-
|
|
1
|
+
import{useShellLocale as e}from"./chunk-L6XEON5Q.js";import{formatPlain as t}from"./chunk-C3QOHMR6.js";import{jsx as r,jsxs as n}from"react/jsx-runtime";var i={danger:"bg-red-600 text-white",neutral:"bg-gray-600 text-white",accent:"bg-blue-600 text-white"};function a({count:a=0,max:l=99,dot:s=!1,tone:o="danger",showZero:c=!1,children:m,className:u=""}){const h=s||a>0||0===a&&c,d=e(),x=a>l?`${t(l,d)}+`:t(a,d),f=m?"":u,g=h?/* @__PURE__ */r("span",s?{className:`block h-2.5 w-2.5 rounded-full ring-2 ring-white ${i[o]} ${f}`.trim(),"aria-hidden":m?"true":void 0}:{className:`flex h-5 min-w-[1.25rem] items-center justify-center whitespace-nowrap rounded-full px-1 text-xs font-semibold tabular-nums ring-2 ring-white ${i[o]} ${f}`.trim(),children:x}):null;return m?/* @__PURE__ */n("span",{className:`relative inline-flex ${u}`.trim(),children:[m,g&&/* @__PURE__ */r("span",{className:"absolute -right-1.5 -top-1.5 flex",children:g})]}):g}export{a as CountBadge};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{LIGHTBOX_PICTURE_FIT as e,ZoomableImage as t}from"./chunk-CGUMJZUB.js";import{isVideoUrl as r,mediaFileName as n}from"./chunk-
|
|
1
|
+
import{LIGHTBOX_PICTURE_FIT as e,ZoomableImage as t}from"./chunk-CGUMJZUB.js";import{isVideoUrl as r,mediaFileName as n}from"./chunk-COF2CF5R.js";import{dialogA11y as o}from"./chunk-VWGWZY7A.js";import{useDismissPopupsOnOpen as a}from"./chunk-7QSDPSXP.js";import{useFocusTrap as l,useScrollLock as i}from"./chunk-DWGYC7OD.js";import{Button_default as c}from"./chunk-EVYD6UFQ.js";import{Icon as s}from"./chunk-ISVODSRP.js";import{Z_LAYERS as m}from"./chunk-62LW225J.js";import{useHydrated as u}from"./chunk-D65T4H6J.js";import{buttonClasses as d}from"./chunk-UQYNPYF4.js";import{registerModalEscapeInterceptor as f}from"./chunk-TWVUQUUD.js";import{useShellStrings as h}from"./chunk-L6XEON5Q.js";import{useRef as p,useState as x,useCallback as b,useEffect as k}from"react";import{createPortal as g}from"react-dom";import{jsx as v,jsxs as w,Fragment as N}from"react/jsx-runtime";var y=/\.(pdf|docx?|xlsx?|pptx?|csv|txt|zip|rar|7z|dwg|dxf|stp|step|igs|iges)(?:[?#]|$)/i;function j(e){return e.kind?e.kind:r(e.url)?"video":y.test(e.url)?"file":"image"}var C="flex items-center justify-center rounded-full bg-black/60 text-on-accent hover:bg-black/80 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",D=e=>e.stopPropagation();function F({images:r,startIndex:y=0,onClose:F,onIndexChange:U,onOpenFile:O}){const $=h().lightbox,z=u(),I=p(null),L=p(null),[P,Q]=x(y),W=r.length,Y=z&&W>0,A=b(e=>{if(W<2)return;const t=((P+e)%W+W)%W;Q(t),U?.(t)},[P,W,U]);if(a(Y),l(I,Y,L),i(Y),k(()=>{if(Y)return f(()=>(F(),!0),()=>I.current)},[Y,F]),k(()=>{if(!Y)return;const e=e=>{"ArrowLeft"!==e.key&&"ArrowRight"!==e.key||e.target?.closest?.("video")||(e.preventDefault(),A("ArrowRight"===e.key?1:-1))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[Y,A]),!Y)return null;const E=r[Math.min(P,W-1)],R=j(E),S=E.caption||n(E.url);let V;return V="video"===R?/* @__PURE__ */v("video",{src:E.url,controls:!0,playsInline:!0,"aria-label":S,onClick:D,className:`${e} rounded-lg bg-black`}):"file"===R?/* @__PURE__ */w("div",{onClick:D,className:"flex max-w-[calc(100vw-144px)] flex-col items-center gap-3 rounded-lg bg-surface px-10 py-8 text-center text-ink-faint",children:[
|
|
2
2
|
/* @__PURE__ */v(s,{name:"document","aria-hidden":"true",className:"h-10 w-10"}),
|
|
3
|
-
/* @__PURE__ */v("span",{className:"max-w-[60ch] break-all text-sm font-medium text-ink",children:
|
|
4
|
-
/* @__PURE__ */w("div",{ref:
|
|
3
|
+
/* @__PURE__ */v("span",{className:"max-w-[60ch] break-all text-sm font-medium text-ink",children:S}),O?/* @__PURE__ */v(c,{size:"sm",onClick:()=>O(E),children:$.openFile}):/* @__PURE__ */v("a",{href:E.url,target:"_blank",rel:"noopener noreferrer",className:d({size:"sm"}),children:$.openFile})]}):/* @__PURE__ */v(t,{src:E.url,alt:S,className:`${e} object-contain`,frameClassName:"rounded-lg"}),g(
|
|
4
|
+
/* @__PURE__ */w("div",{ref:I,...o({role:"dialog",modal:!0,label:$.label}),"data-lightbox-backdrop":"",className:"fixed inset-0 flex items-center justify-center bg-black/80",style:{zIndex:m.overlay},onClick:F,children:[V,
|
|
5
5
|
/* @__PURE__ */w("div",{className:"absolute right-4 top-4 flex items-center gap-2",onClick:D,children:[
|
|
6
6
|
/* @__PURE__ */v("span",{className:"rounded bg-black/60 px-2 py-1 text-xs text-on-accent tabular-nums",children:$.counter(P+1,W)}),
|
|
7
|
-
/* @__PURE__ */v("button",{ref:
|
|
8
|
-
/* @__PURE__ */v("button",{type:"button",onClick:e=>{D(e),
|
|
9
|
-
/* @__PURE__ */v("button",{type:"button",onClick:e=>{D(e),
|
|
7
|
+
/* @__PURE__ */v("button",{ref:L,type:"button",onClick:F,"aria-label":$.close,className:`${C} h-8 w-8`,children:/* @__PURE__ */v(s,{name:"close","aria-hidden":"true",className:"h-4 w-4"})})]}),W>1&&/* @__PURE__ */w(N,{children:[
|
|
8
|
+
/* @__PURE__ */v("button",{type:"button",onClick:e=>{D(e),A(-1)},"aria-label":$.previous,className:`${C} absolute left-4 top-1/2 h-10 w-10 -translate-y-1/2`,children:/* @__PURE__ */v(s,{name:"chevron-left","aria-hidden":"true",className:"h-5 w-5"})}),
|
|
9
|
+
/* @__PURE__ */v("button",{type:"button",onClick:e=>{D(e),A(1)},"aria-label":$.next,className:`${C} absolute right-4 top-1/2 h-10 w-10 -translate-y-1/2`,children:/* @__PURE__ */v(s,{name:"chevron-right","aria-hidden":"true",className:"h-5 w-5"})})]}),
|
|
10
10
|
/* @__PURE__ */w("div",{className:"absolute inset-x-18 bottom-4 flex items-center justify-center gap-3",onClick:D,children:[
|
|
11
|
-
/* @__PURE__ */v("span",{className:"min-w-0 break-words text-center text-sm text-on-accent/85",children:
|
|
11
|
+
/* @__PURE__ */v("span",{className:"min-w-0 break-words text-center text-sm text-on-accent/85",children:S}),"file"!==R&&/* @__PURE__ */v("a",{href:E.url,target:"_blank",rel:"noopener noreferrer",className:"flex-none text-xs font-medium text-on-accent/70 underline decoration-on-accent/30 underline-offset-2 hover:text-on-accent",children:$.openOriginal})]})]}),document.body)}export{F as ImageLightbox,j as lightboxKind};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import{nextEnabledIndex as e}from"./chunk-EO5RLFRX.js";import{flattenOptionItems as t,filterOptionItems as n,optionMatches as r,groupedRows as l,OptionCheck as o,OptionSublabel as i}from"./chunk-K5YT5PMJ.js";import{END_ACTIONS_PAD as a,InputEndActionSlot as s,InputEndActionButton as c}from"./chunk-PT4GMPUB.js";import{INPUT_BASE_ON as u,INPUT_BASE as d}from"./chunk-AYZY3YNC.js";import{Button_default as h}from"./chunk-EVYD6UFQ.js";import{Icon as p}from"./chunk-ISVODSRP.js";import{LoadingSpinner as m}from"./chunk-R2VKEMZH.js";import{Tooltip as f}from"./chunk-SOZCWT6I.js";import{onOverlayOpen as b}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as g}from"./chunk-62LW225J.js";import{useDropdownPosition as v,MENU_MAX_HEIGHT as w}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as y}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as x}from"./chunk-TWVUQUUD.js";import{GLASS_DIVIDER as k,glassStyle as j}from"./chunk-5FYDNH4Y.js";import{useShellStrings as $}from"./chunk-L6XEON5Q.js";import{useState as N,useId as D,useRef as C,useMemo as S,useEffect as W}from"react";import{createPortal as M}from"react-dom";import{jsxs as E,jsx as R}from"react/jsx-runtime";function T(e,t){const n=e.length;if(0===n||t(e.join(", ")))return{shown:n,cut:!1};if(1===n)return{shown:1,cut:!0};let r=0;for(let l=1;l<n&&t(`${e.slice(0,l).join(", ")} +${n-l}`);l+=1)r=l;return{shown:r,cut:!1}}var F=["right-2","right-8","right-16"],L=[8,32,64];function O(O){const{options:z,placeholder:A,emptyOptionLabel:U,className:Y="",disabled:I,id:B,filter:H=!1,allowFreeText:P=!1,freeTextOption:J,onSearchChange:V,loading:G=!1,error:K,onRetry:Q,rightAdornment:Z,endAction:X,renderOption:q,clearable:_=!0,"aria-label":ee,"aria-labelledby":te,"aria-describedby":ne}=O,re=!0===O.multiple,le=O.multiple?O.value:O.value?[O.value]:[],oe=O.multiple?"":O.value,ie=e=>{O.multiple?O.onChange(e):O.onChange(e[0]??"")},ae=le.length>0,se=H&&ae&&!I,ce=re||H,ue=null!=J,de=P||ue,[he,pe]=N(!1),[me,fe]=N(-1),be=D(),ge=B??`${be}-input`,ve=`${be}-listbox`,we=e=>`${be}-opt-${e}`,[ye,xe]=N(""),ke=$(),je=U??ke.select.none,$e=e=>{xe(e),fe(-1),V?.(e)},Ne=C(null),De=C(null),Ce=C(null),Se=C(null),We=C(he);We.current=he;const Me=C(!1),Ee=e=>{We.current&&(We.current=!1,e&&P&&!ue&&et&&(re?le.includes(et)||ie([...le,et]):et!==oe&&ie([et])),pe(!1),$e(""))},Re=(e,t)=>{if(!e.disabled){if(re)return ie(le.includes(e.value)?le.filter(t=>t!==e.value):[...le,e.value]),void(e===tt?$e(""):fe(t));ie([e.value]),Ee(!1)}},[Te,Fe]=N(null);y(()=>{if(!Z||he)return void Fe(null);const e=Se.current?.offsetWidth??0;Fe(e?e+L[Ie]+6:null)});const Le=v(De,he,ce?{popupRef:Ce}:{matchTriggerWidth:!0}),Oe=S(()=>t(z),[z]),ze=le.join("\0"),Ae=S(()=>{const e=[],t=/* @__PURE__ */new Set;for(const n of Oe)le.includes(n.value)&&!t.has(n.value)&&(t.add(n.value),e.push(n.label));if(de)for(const n of le)t.has(n)||e.push(n);return e},[Oe,ze,de]),Ue=Ae.join(", "),Ye=_&&ae&&!I,Ie=(Ye?1:0)+(X?1:0),[Be,He]=N(null),Pe=C(null),Je=C(""),Ve=C(()=>{});Ve.current=()=>{const e=De.current,t=Pe.current;if(!re||!e||!t)return;const n=getComputedStyle(e),r=e.clientWidth-(parseFloat(n.paddingLeft)||0)-(parseFloat(n.paddingRight)||0),l=[n.fontStyle,n.fontWeight,n.fontSize,n.fontFamily,n.letterSpacing].join("|"),o=`${r}|${l}|${Ae.join("\0")}`;if(o===Je.current)return;Je.current=o;let i=null;r>0&&Ae.length>0&&(t.style.fontStyle=n.fontStyle,t.style.fontWeight=n.fontWeight,t.style.fontSize=n.fontSize,t.style.fontFamily=n.fontFamily,t.style.letterSpacing=n.letterSpacing,i=T(Ae,e=>(t.textContent=e,t.getBoundingClientRect().width<=r)),t.textContent=""),He(e=>e?.shown===i?.shown&&e?.cut===i?.cut?e:i)},y(()=>{Ve.current()}),W(()=>{const e=De.current;if(!re||!e||"undefined"==typeof ResizeObserver)return;const t=new ResizeObserver(()=>Ve.current());return t.observe(e),()=>t.disconnect()},[re]);const Ge=Ae.length,Ke=!re||!Be||Be.shown>=Ge?Ue:0===Be.shown?ke.select.selectedCount(Ge):`${Ae.slice(0,Be.shown).join(", ")} +${Ge-Be.shown}`,Qe=re&&null!==Be&&(Be.shown<Ge||Be.cut),Ze=he&&ae&&ce;W(()=>{if(!he)return;const e=e=>{const t=e.target;Ne.current?.contains(t)||Ce.current?.contains(t)||Ee(!0)};document.addEventListener("mousedown",e);const t=b(()=>Ee(!0));return()=>{document.removeEventListener("mousedown",e),t()}},[he,P,ye,ze,O.onChange]),W(()=>{if(he)return x(e=>!("Escape"!==e.key||!We.current)&&(Ee(!1),De.current?.blur(),!0),()=>Ce.current)},[he]);const Xe=S(()=>{const e=/* @__PURE__ */new Set;return n(z,t=>!e.has(t.value)&&(e.add(t.value),!0))},[z]),qe=S(()=>{if(V)return Xe;const e=ye.trim().toLowerCase();return e?n(Xe,t=>r(t,e)):Xe},[Xe,ye,V]),_e=S(()=>t(qe),[qe]),et=ye.trim(),tt=S(()=>ue&&et?Oe.some(e=>e.label===et)||le.includes(et)?null:{value:et,label:et}:null,[ue,et,Oe,ze]),nt=S(()=>tt?[..._e,tt]:_e,[_e,tt]);/* @__PURE__ */
|
|
2
|
+
return E("div",{ref:Ne,className:"relative group",onBlur:e=>{const t=e.relatedTarget;t&&(Ne.current?.contains(t)||Ce.current?.contains(t))||Me.current||document.activeElement!==De.current&&Ee(!0)},children:[(rt=/* @__PURE__ */R("input",{id:ge,ref:De,type:"text",autoComplete:"off",role:"combobox","aria-expanded":he,"aria-haspopup":"listbox","aria-autocomplete":"list","aria-controls":he?ve:void 0,"aria-activedescendant":he&&me>=0&&me<nt.length?we(me):void 0,"aria-label":te?void 0:ee,"aria-labelledby":te,"aria-describedby":ne,value:he?ye:Ke,onChange:e=>{$e(e.target.value),pe(!0)},onFocus:()=>{I||($e(""),pe(!0))},onKeyDown:t=>{if("ArrowDown"===t.key||"ArrowUp"===t.key){if(I)return;if(t.preventDefault(),!he)return void pe(!0);if(0===nt.length)return;const n="ArrowDown"===t.key?1:-1;return void fe(t=>e(nt,t,n))}"Enter"===t.key?(t.preventDefault(),he&&me>=0&&me<nt.length?Re(nt[me],me):1!==_e.length||_e[0].disabled?P&&!ue&&et&&(re?(le.includes(et)||ie([...le,et]),$e("")):(ie([et]),Ee(!1),De.current?.blur())):Re(_e[0],0)):"Escape"===t.key?(Ee(!1),De.current?.blur()):"Tab"===t.key&&Ee(!0)},placeholder:Ze?Ke:A||je,className:`${se?u:d} ${Y} ${a[Ie]}${I?"bg-surface-sunken text-ink-faintest cursor-not-allowed":""} truncate${Ze?" rosh-field-shows-choice":""}`,style:Te?{paddingRight:Te}:void 0,disabled:I}),re?/* @__PURE__ */R(f,{content:!he&&Qe?Ue:null,className:"block",children:rt}):rt),re&&
|
|
3
|
+
/* @__PURE__ */R("div",{"aria-hidden":"true",className:"pointer-events-none invisible absolute left-0 top-0 h-0 w-0 overflow-hidden",children:/* @__PURE__ */R("span",{ref:Pe,className:"whitespace-pre"})}),Ie>0&&
|
|
4
|
+
/* @__PURE__ */E(s,{children:[Ye&&
|
|
5
|
+
/* @__PURE__ */R("span",{onMouseDown:e=>e.preventDefault(),className:"flex opacity-0 transition-opacity group-hover:opacity-100 focus-within:opacity-100",children:/* @__PURE__ */R(c,{action:{label:ke.select.clear,icon:/* @__PURE__ */R(p,{name:"close"}),onClick:()=>{ie([]),Ee(!1)}}})}),X&&/* @__PURE__ */R("span",{onMouseDown:e=>e.preventDefault(),className:"flex",children:/* @__PURE__ */R(c,{action:X})})]}),Z&&!he&&/* @__PURE__ */R("div",{ref:Se,className:`absolute top-1/2 -translate-y-1/2 ${F[Ie]} flex items-center gap-1 flex-nowrap justify-end pointer-events-none`,children:Z}),he&&M(
|
|
6
|
+
/* @__PURE__ */E("div",{ref:Ce,onMouseDownCapture:()=>{Me.current=!0,setTimeout(()=>{Me.current=!1},0)},className:"fixed rounded-(--radius-popup) overflow-hidden",style:{zIndex:g.popup,left:Le?.left,right:Le?.right,top:Le?.top,bottom:Le?.bottom,minWidth:Le?.minWidth,width:Le?.width,...ce&&{maxWidth:Le?.maxWidth},visibility:Le?void 0:"hidden",...j()},children:[re&&ae&&_&&!I&&
|
|
7
|
+
/* @__PURE__ */R("button",{type:"button",tabIndex:-1,onMouseDown:e=>{e.preventDefault(),ie([])},className:`block w-full text-left px-3 min-h-(--row-height-menu) py-2 leading-5 text-sm text-gray-600 hover:bg-row-hover border-b ${k}`,children:ke.select.clearAll}),G?
|
|
8
|
+
/* @__PURE__ */R(m,{size:"sm",padding:"py-2",label:ke.search.searching}):K?/* @__PURE__ */E("div",{role:"alert",className:"flex items-center gap-2 px-3 py-2 text-sm text-red-600",children:[
|
|
9
|
+
/* @__PURE__ */R("span",{className:"min-w-0 flex-1",children:K}),Q&&/* @__PURE__ */R(h,{variant:"link",size:"sm",onMouseDown:e=>e.preventDefault(),onClick:Q,className:"shrink-0",children:ke.list.retry})]}):null,
|
|
10
|
+
/* @__PURE__ */E("div",{id:ve,role:nt.length?"listbox":void 0,"aria-labelledby":nt.length?te??(ee?void 0:ge):void 0,"aria-label":nt.length&&!te?ee:void 0,"aria-multiselectable":!(!nt.length||!re)||void 0,className:"overflow-y-auto",style:{maxHeight:Le?.maxHeight??w},children:[0===nt.length?G||K?null:/* @__PURE__ */R("p",{className:"px-3 py-3 text-sm text-ink-faintest text-center",children:ke.select.noMatches}):0===_e.length?null:l(qe,(e,t)=>{const n=le.includes(e.value);/* @__PURE__ */
|
|
11
|
+
return E("button",{id:we(t),type:"button",role:"option","aria-selected":n,"aria-disabled":e.disabled||void 0,tabIndex:-1,onMouseDown:n=>{(e.disabled||re)&&n.preventDefault(),Re(e,t)},className:"w-full overflow-hidden text-left px-3 min-h-(--row-height-menu) py-2 text-sm flex items-center justify-between gap-2 whitespace-nowrap "+(e.disabled?"cursor-not-allowed text-gray-400":`hover:bg-gray-50 ${n?"text-blue-600 font-medium":"text-gray-700"} ${t===me?"bg-gray-100":n?"bg-blue-50/50":""}`),children:[re&&/* @__PURE__ */R(o,{selected:n}),
|
|
12
|
+
/* @__PURE__ */R("span",{className:`min-w-0 ${ce?"flex-auto":"flex-1"} truncate`,children:q?q(e,{selected:n,active:t===me}):e.label}),e.sublabel&&/* @__PURE__ */R(i,{grows:ce,children:e.sublabel})]},e.value)},be),tt&&J&&
|
|
13
|
+
/* @__PURE__ */R("button",{id:we(_e.length),type:"button",role:"option","aria-selected":!1,tabIndex:-1,onMouseDown:e=>{re&&e.preventDefault(),Re(tt,_e.length)},className:`w-full overflow-hidden text-left px-3 min-h-(--row-height-menu) py-2 text-sm flex items-center gap-2 whitespace-nowrap text-ink hover:bg-row-hover ${_e.length?`border-t ${k}`:""} ${me===_e.length?"bg-gray-100":""}`,children:/* @__PURE__ */R("span",{className:"min-w-0 flex-1 truncate",children:J(tt.value)})},`${be}-typed`)]})]}),document.body)]});var rt}export{O as SearchableSelect,T as fitChoice};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{useShellPrefs as t}from"./chunk-KC3EX26K.js";import{toast_default as e}from"./chunk-
|
|
2
|
-
return(new Date).toISOString()}var W=null,
|
|
1
|
+
import{useShellPrefs as t}from"./chunk-KC3EX26K.js";import{toast_default as e}from"./chunk-KFNQVNND.js";import{useSyncExternalStore as n,useCallback as o,useMemo as a}from"react";var r=[{id:"bell",label:"Bell",description:"Soft bell with one harmonic"},{id:"chime",label:"Chime",description:"Two-note ascending chime"},{id:"bowl",label:"Singing Bowl",description:"Long-decay meditation tone"},{id:"wind-chimes",label:"Wind Chimes",description:"Four soft tones in succession"},{id:"off",label:"Off (silent)",description:"No sound — only desktop notification"}],i=[{id:"none",label:"None"},{id:"tick-fast",label:"Ticking Fast"},{id:"tick-slow",label:"Ticking Slow"},{id:"rain",label:"Rain"},{id:"fireplace",label:"Fireplace"},{id:"white",label:"White Noise"},{id:"pink",label:"Pink Noise"},{id:"brown",label:"Brown Noise"}],c=()=>`pomodoro-${/* @__PURE__ */(new Date).toISOString().slice(0,10)}`,l={focus:1500,short:300,long:900},s="bell",u=100,d=1,f="none",m=50,h={autoStartBreaks:!1,autoStartPomodoros:!1,longBreakInterval:4},g={running:!1,remaining:l.focus,mode:"focus",total:l.focus,streak:0,count:"undefined"!=typeof localStorage?(()=>{try{return parseInt(localStorage.getItem(c())||"0",10)||0}catch{return 0}})():0},p=null,k=/* @__PURE__ */new Set,w=t=>{g={...g,...t},k.forEach(t=>t())};function M(){return g}function S(t){return k.add(t),()=>{k.delete(t)}}function b(t){l=t,g.running||g.remaining!==g.total||w({remaining:t[g.mode],total:t[g.mode]})}function y(t){s=t}function v(t,e){u=Math.max(0,Math.min(100,Math.round(t))),d=Math.max(1,Math.min(5,Math.round(e)))}function T(t){h={autoStartBreaks:!!t.autoStartBreaks,autoStartPomodoros:!!t.autoStartPomodoros,longBreakInterval:Math.max(1,Math.min(20,Math.round(t.longBreakInterval||4)))}}function A(t,e){f=t,m=Math.max(0,Math.min(100,Math.round(e))),g.running&&"focus"===g.mode?(R(),F()):"none"!==t&&0!==m||R()}function I(){g.running||(w({running:!0}),p=setInterval(N,1e3),"focus"===g.mode&&F())}function x(){(g.running||null!==p)&&(null!==p&&(clearInterval(p),p=null),w({running:!1}),R())}function B(t){x(),w({mode:t,remaining:l[t],total:l[t]})}function N(){g.remaining<=1?function(){null!==p&&(clearInterval(p),p=null);R(),C(s,{volume:u,repeat:d});const t="focus"===g.mode?"Pomodoro complete — time for a break! 🍅":"Break's over — back to work!";if("undefined"!=typeof Notification&&"granted"===Notification.permission)try{new Notification(t)}catch{}try{e.info(t)}catch{}if("focus"===g.mode){const t=g.streak+1,e=g.count+1;(t=>{try{localStorage.setItem(c(),String(t))}catch{}})(e);const n=t%h.longBreakInterval===0?"long":"short";w({running:!1,streak:t,count:e,mode:n,remaining:l[n],total:l[n]}),h.autoStartBreaks&&setTimeout(()=>I(),50)}else w({running:!1,mode:"focus",remaining:l.focus,total:l.focus}),h.autoStartPomodoros&&setTimeout(()=>I(),50)}():w({remaining:g.remaining-1})}function C(t=s,e={}){if("off"===t)return;const n=Math.max(0,Math.min(100,e.volume??100))/100;if(0===n)return;const o=Math.max(1,Math.min(5,e.repeat??1));for(let e=0;e<o;e++)setTimeout(()=>P(t,n),2500*e)}function P(t,e){try{const n=window.AudioContext||window.webkitAudioContext;if(!n)return;const o=new n,a=(t,n,a,r=.22,i="sine")=>{const c=o.createOscillator(),l=o.createGain();c.connect(l),l.connect(o.destination),c.type=i,c.frequency.value=t;const s=o.currentTime+n;l.gain.setValueAtTime(0,s),l.gain.linearRampToValueAtTime(r*e,s+.03),l.gain.exponentialRampToValueAtTime(1e-4,s+a),c.start(s),c.stop(s+a)};let r=2;"bell"===t?(a(880,0,1.8),a(1320,0,1.4,.1),r=2):"chime"===t?(a(659.25,0,.7),a(880,.2,1.3),r=2):"bowl"===t?(a(440,0,3.4,.22),a(660,0,3,.08),a(880,.05,2.8,.05),r=4):"wind-chimes"===t&&(a(1175,0,1.1,.16),a(880,.15,1.3,.16),a(1318,.3,1.5,.16),a(1047,.5,1.7,.13),r=3),setTimeout(()=>{try{o.close()}catch{}},1e3*r+500)}catch{}}var D=null,_={none:0,white:.3,pink:.3,brown:.3,"tick-fast":.6,"tick-slow":.6,rain:.4,fireplace:.5};function O(t,e){if("none"===e)return null;const n=t.sampleRate,o="white"===e||"pink"===e||"brown"===e?2:4,a=n*o,r=t.createBuffer(1,a,n),i=r.getChannelData(0);if("white"===e)for(let t=0;t<a;t++)i[t]=.5*(2*Math.random()-1);else if("pink"===e){let t=0,e=0,n=0,o=0,r=0,c=0,l=0;for(let s=0;s<a;s++){const a=2*Math.random()-1;t=.99886*t+.0555179*a,e=.99332*e+.0750759*a,n=.969*n+.153852*a,o=.8665*o+.3104856*a,r=.55*r+.5329522*a,c=-.7616*c-.016898*a,i[s]=.11*(t+e+n+o+r+c+l+.5362*a)*.55,l=.115926*a}}else if("brown"===e){let t=0;for(let e=0;e<a;e++){t=(t+.02*(2*Math.random()-1))/1.02,i[e]=3.5*t*.5}}else if("tick-fast"===e||"tick-slow"===e){const t="tick-fast"===e?.5:1,r=Math.floor(.045*n);for(let e=0;e<o;e+=t){const t=Math.floor(e*n);for(let e=0;e<r&&t+e<a;e++){const o=Math.exp(-e/n*180),a=2*Math.random()-1,r=Math.sin(2*Math.PI*1100*(e/n));i[t+e]+=(.7*a+.25*r)*o*.55}}}else if("rain"===e){let t=0;for(let e=0;e<a;e++){const o=2*Math.random()-1,a=o-.93*t;t=o;const r=.7+.3*Math.sin(e/n*2*Math.PI*.25);i[e]=a*r*.4}}else if("fireplace"===e){let t=0;for(let e=0;e<a;e++){t=(t+.02*(2*Math.random()-1))/1.02,i[e]=1.6*t}let e=.4*Math.random()*n;for(;e<a;){const t=Math.floor((.012+.05*Math.random())*n),o=.35+.45*Math.random(),r=Math.floor(e);for(let e=0;e<t&&r+e<a;e++){const t=Math.exp(-e/n*90);i[r+e]+=(2*Math.random()-1)*t*o}e+=(.08+.62*Math.random())*n}}return r}function F(){if(!D&&"none"!==f&&0!==m)try{const t=window.AudioContext||window.webkitAudioContext;if(!t)return;const e=new t,n=O(e,f);if(!n){try{e.close()}catch{}return}const o=e.createBufferSource();o.buffer=n,o.loop=!0;const a=e.createGain();a.gain.value=m/100*_[f],o.connect(a).connect(e.destination),o.start(),D={ctx:e,src:o,gain:a}}catch{}}function R(){if(D){try{D.src.stop()}catch{}try{D.ctx.close()}catch{}D=null}}function V(t,e){if("none"!==t&&0!==e)try{const n=window.AudioContext||window.webkitAudioContext;if(!n)return;const o=new n,a=O(o,t);if(!a){try{o.close()}catch{}return}const r=o.createBufferSource();r.buffer=a,r.loop=!0;const i=o.createGain();i.gain.value=e/100*_[t],r.connect(i).connect(o.destination),r.start(),setTimeout(()=>{try{r.stop()}catch{}try{o.close()}catch{}},3e3)}catch{}}var G="pomodoro_tasks",K="pomodoro_tasks_migrated";function j(){return Math.random().toString(36).slice(2,11)}function E(){/* @__PURE__ */
|
|
2
|
+
return(new Date).toISOString()}var W=null,q=[],J=!1,L=null,Q=/* @__PURE__ */new Set;function X(){for(const t of Q)t()}function $(t){q=t,X()}function z(){const t=W;return t?L=t.list().then(e=>{W===t&&(q=e,J=!0,X())}).catch(()=>{W===t&&(J=!0,X())}).finally(()=>{L=null}):(q=[],J=!0,X(),Promise.resolve())}function H(t){W=t,q=[],J=!1,t?z():X()}function U(t){return Q.add(t),!W||J||L||z(),()=>{Q.delete(t)}}function Y(){return q}function Z(){const e=function(){const{prefs:e,save:n}=t(),r=a(()=>{const t=e.todo_tasks;return Array.isArray(t)?t:[]},[e.todo_tasks]),i=o(t=>{n({todo_tasks:t})},[n]),c=o(t=>{const e=j(),n=E(),o={done:!1,...t,name:t.name.trim(),id:e,createdAt:n,updatedAt:n};return i([...r,o]),e},[r,i]),l=o((t,e)=>{i(r.map(n=>n.id===t?{...n,...e,id:n.id,updatedAt:E()}:n))},[r,i]),s=o(t=>{i(r.filter(e=>e.id!==t))},[r,i]),u=o(t=>{const e=r.find(e=>e.id===t);e&&l(t,{done:!e.done})},[r,l]);return{tasks:r,addTask:c,updateTask:l,removeTask:s,toggleDone:u,setAllTasks:i}}(),r=n(U,Y,Y),i=o(t=>{const n=W;if(!n)return e.addTask(t);const o="tmp-"+j(),a=E(),r={done:!1,...t,name:t.name.trim(),id:o,createdAt:a,updatedAt:a};return $([...q,r]),n.create({...t,name:t.name.trim()}).then(t=>$(q.map(e=>e.id===o?{...r,...t}:e))).catch(()=>$(q.filter(t=>t.id!==o))),o},[e]),c=o((t,n)=>{const o=W;if(!o)return e.updateTask(t,n);$(q.map(e=>e.id===t?{...e,...n,id:t,updatedAt:E()}:e)),o.update(t,n).catch(()=>{z()})},[e]),l=o(t=>{const n=W;if(!n)return e.removeTask(t);const o=q;$(q.filter(e=>e.id!==t)),n.remove(t).catch(()=>$(o))},[e]),s=o(t=>{if(!W)return e.toggleDone(t);const n=q.find(e=>e.id===t);n&&c(t,{done:!n.done})},[e,c]),u=o(t=>{W||e.setAllTasks(t)},[e]);return null===W?e:{tasks:r,addTask:i,updateTask:c,removeTask:l,toggleDone:s,setAllTasks:u}}function tt(t,e){try{if(localStorage.getItem(K))return;const n=localStorage.getItem(G);if(!n)return void localStorage.setItem(K,"1");const o=JSON.parse(n);if(!Array.isArray(o)||0===o.length)return localStorage.removeItem(G),void localStorage.setItem(K,"1");const a=E(),r=o.filter(t=>"string"==typeof t?.name).map(t=>({id:t.id||j(),name:String(t.name),done:!!t.done,estimated:"number"==typeof t.estimated?t.estimated:void 0,completed:"number"==typeof t.completed?t.completed:void 0,createdAt:a,updatedAt:a})),i=new Set(t.map(t=>t.id));e([...r.filter(t=>!i.has(t.id)),...t]),localStorage.removeItem(G),localStorage.setItem(K,"1")}catch{try{localStorage.setItem(K,"1")}catch{}}}export{r as ALARM_OPTIONS,i as FOCUS_SOUND_OPTIONS,M as getPomoSnapshot,tt as migratePomodoroTasksOnce,C as playAlarm,x as pomoPause,I as pomoStart,B as pomoSwitchMode,V as previewFocusSound,y as setPomoAlarm,v as setPomoAlarmConfig,T as setPomoBehaviour,b as setPomoDurations,A as setPomoFocusSound,H as setShellTodoProvider,S as subscribePomo,Z as useTodoTasks};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{useShellLocale as e}from"./chunk-
|
|
2
|
-
return t(
|
|
3
|
-
/* @__PURE__ */t("div",{className:`${
|
|
1
|
+
import{useShellLocale as e}from"./chunk-L6XEON5Q.js";import{formatPlain as r}from"./chunk-C3QOHMR6.js";import{useId as d,Children as n}from"react";import{jsxs as t,jsx as a}from"react/jsx-runtime";var i={none:{body:"",edge:"px-4 py-3"},sm:{body:"p-3",edge:"px-3 py-2"},md:{body:"p-4",edge:"px-4 py-3"},lg:{body:"p-6",edge:"px-6 py-4"}},l={neutral:"border-line",warning:"border-amber-300",current:"border-line"};function s({children:e,header:r,description:s,footer:c,padded:o=!0,padding:m,headingLevel:b,headerActions:u,"aria-label":p,className:h="",bodyClassName:x="",style:g,tone:f="neutral"}){const y=i[m??(o?"md":"none")],N=d(),v=d(),$=null!=r&&null!=s&&""!==s,w=null!=b&&null!=r,j=`h${b}`,k=null!=p&&""!==p,A=w||k,C=A?"section":"div",L=`rounded-(--radius-card) border ${l[f]} bg-surface shadow-sm ${h}`.trim(),O=n.toArray(e).length>0,Q=O?"border-b border-line-subtle ":"",B="current"===f,E=B?"text-base font-semibold text-blue-700":"text-base font-semibold text-ink-strongest",H=B?"rounded-t-(--radius-card) bg-accent-tint ":"",M=`${Q}${H}${y.edge} ${E}`;/* @__PURE__ */
|
|
2
|
+
return t(C,{className:L,style:g,...k?{"aria-label":p}:w?{"aria-labelledby":N}:{},...$&&A?{"aria-describedby":v}:{},...B?{"aria-current":!0}:{},children:[$?
|
|
3
|
+
/* @__PURE__ */t("div",{className:`${Q}${H}${y.edge}`,children:[null!=u?/* @__PURE__ */t("div",{className:`flex items-center justify-between gap-3 ${E}`,children:[w?/* @__PURE__ */a(j,{id:N,children:r}):/* @__PURE__ */a("span",{children:r}),u]}):w?/* @__PURE__ */a(j,{id:N,className:E,children:r}):/* @__PURE__ */a("div",{className:E,children:r}),
|
|
4
4
|
/* @__PURE__ */a("p",{id:v,className:B?"mt-0.5 text-xs text-gray-600":"mt-0.5 text-xs text-ink-faint",children:s})]}):null!=r&&(null!=u?
|
|
5
|
-
/* @__PURE__ */t("div",{className:`${
|
|
6
|
-
/* @__PURE__ */a(j,{id:N,className:
|
|
5
|
+
/* @__PURE__ */t("div",{className:`${M} flex items-center justify-between gap-3`,children:[w?/* @__PURE__ */a(j,{id:N,children:r}):/* @__PURE__ */a("span",{children:r}),u]}):w?
|
|
6
|
+
/* @__PURE__ */a(j,{id:N,className:M,children:r}):/* @__PURE__ */a("div",{className:M,children:r})),O&&/* @__PURE__ */a("div",{className:[y.body,x].filter(Boolean).join(" "),children:e}),c&&/* @__PURE__ */a("div",{className:`border-t border-gray-100 ${y.edge}`,children:c})]})}function c({label:d,value:n,icon:i,delta:l,className:s=""}){const c=e(),o="number"==typeof n&&c?r(n,c):n,m="up"===l?.direction?"text-green-600":"down"===l?.direction?"text-red-600":"text-gray-500",b="up"===l?.direction?"▲":"down"===l?.direction?"▼":"→";/* @__PURE__ */
|
|
7
7
|
return t("div",{className:`rounded-(--radius-card) border border-gray-200 bg-white p-4 shadow-sm ${s}`.trim(),children:[
|
|
8
8
|
/* @__PURE__ */t("div",{className:"flex items-center justify-between text-ink-faint",children:[
|
|
9
9
|
/* @__PURE__ */a("span",{className:"text-xs font-medium uppercase tracking-wide",children:d}),i]}),
|