efficient-shell 11.12.0 → 12.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -12
- package/dist/{Browser-LPGSKKLU.js → Browser-CXZAXF55.js} +17 -17
- package/dist/Calculator-TKQRQGTI.js +29 -0
- package/dist/{CurrencyConverter-N2HQT7IR.js → CurrencyConverter-WFC3TAL4.js} +12 -12
- package/dist/Files-QM5PW6BX.js +88 -0
- package/dist/{Notepad-JCWNOQET.js → Notepad-B7CKQ54M.js} +9 -9
- package/dist/PdfViewer-3UEC5TNN.js +1 -0
- package/dist/{PomodoroTimer-356JUEM3.js → PomodoroTimer-JMJORKWZ.js} +68 -68
- package/dist/{Preview-X7XNDI6X.js → Preview-OELV5X55.js} +27 -27
- package/dist/Sidebar-SZ5OGL6C.js +44 -0
- package/dist/{Stock-2XOOZNRR.js → Stock-R3436P6X.js} +3 -3
- package/dist/{Weather-ZDU2722T.js → Weather-6N3ZPO2Q.js} +18 -18
- package/dist/{WorldClock-PQGERFCH.js → WorldClock-BJKYHGLS.js} +6 -6
- package/dist/ai/index.js +58 -58
- package/dist/apps/index.d.ts +9 -27
- package/dist/apps/index.js +1 -1
- package/dist/bin/media-host-check.js +1 -1
- package/dist/bin/ui-check.js +1 -1
- package/dist/brand.css +1 -1
- package/dist/charts/BoxPlotChart.js +1 -1
- package/dist/charts/CandlestickChart.js +1 -1
- package/dist/charts/CartesianPlot.js +1 -1
- package/dist/charts/ChartBrush.js +1 -1
- package/dist/charts/ChartFrame.js +1 -1
- package/dist/charts/ChartSkeleton.js +1 -1
- package/dist/charts/ChordChart.js +1 -1
- package/dist/charts/ColumnChart.js +1 -1
- package/dist/charts/FunnelChart.js +1 -1
- package/dist/charts/HeatmapChart.js +1 -1
- package/dist/charts/HistogramChart.js +1 -1
- package/dist/charts/Meter.js +1 -1
- package/dist/charts/PieChart.js +1 -1
- package/dist/charts/RadarChart.js +1 -1
- package/dist/charts/RadialBarChart.js +1 -1
- package/dist/charts/RangeChart.js +1 -1
- package/dist/charts/RankedBars.js +1 -1
- package/dist/charts/SankeyChart.js +1 -1
- package/dist/charts/ScatterChart.js +1 -1
- package/dist/charts/SpecChart.js +1 -1
- package/dist/charts/StatTile.js +1 -1
- package/dist/charts/SunburstChart.js +1 -1
- package/dist/charts/TimeSeriesChart.js +1 -1
- package/dist/charts/TreemapChart.js +1 -1
- package/dist/charts/WaterfallChart.js +1 -1
- package/dist/{chunk-7V32O5NF.js → chunk-2UO47XB4.js} +14 -30
- package/dist/{chunk-FEUTN4GK.js → chunk-33F35NNM.js} +1 -1
- package/dist/{chunk-FUHURDBL.js → chunk-34AHFST2.js} +1 -1
- package/dist/{chunk-UEWB6IOD.js → chunk-3LGPZAVU.js} +2 -2
- package/dist/{chunk-4APQHXLI.js → chunk-3YQICVUP.js} +2 -2
- package/dist/{chunk-IJ6HZXZY.js → chunk-46EBZ7YI.js} +1 -1
- package/dist/{chunk-PTVTNCD6.js → chunk-46VLN6KC.js} +1 -1
- package/dist/{chunk-HOEEFFE3.js → chunk-4ALGGYHV.js} +7 -7
- package/dist/{chunk-34AHNPW7.js → chunk-4DDL6NXB.js} +1 -1
- package/dist/{chunk-F33L4J3P.js → chunk-4K7BA3PD.js} +6 -6
- package/dist/chunk-4LNO444F.js +11 -0
- package/dist/{chunk-225LCPO7.js → chunk-4MERJIJJ.js} +1 -1
- package/dist/chunk-56YJIKVI.js +11 -0
- package/dist/{chunk-GJVGGYQ2.js → chunk-5EWKVVUD.js} +1 -1
- package/dist/chunk-5PDHKH2A.js +3 -0
- package/dist/{chunk-ELIWGIR7.js → chunk-62RAGXWK.js} +9 -9
- package/dist/{chunk-NMQGAP3H.js → chunk-63ZLF7LS.js} +1 -1
- package/dist/chunk-6E47JSLM.js +22 -0
- package/dist/{chunk-3PZI2C4R.js → chunk-6HO7244M.js} +1 -1
- package/dist/{chunk-4TB4CSLB.js → chunk-6KGIHI6X.js} +9 -9
- package/dist/{chunk-OLJUPBY4.js → chunk-6MWLOLLP.js} +1 -1
- package/dist/{chunk-6WPKLF6G.js → chunk-7P2WKDGB.js} +14 -14
- package/dist/{chunk-SPMD7UZO.js → chunk-A34PD3XT.js} +16 -16
- package/dist/{chunk-KVVZLEUG.js → chunk-A3AKJDLI.js} +1 -1
- package/dist/chunk-AEMAGYIZ.js +8 -0
- package/dist/{chunk-JGWUSJDD.js → chunk-AICGATHE.js} +33 -33
- package/dist/{chunk-OCWWEHNR.js → chunk-AIJ6OR6X.js} +2 -2
- package/dist/{chunk-WOOKUEED.js → chunk-AQ3LCE2U.js} +1 -1
- package/dist/{chunk-BOJEZKYS.js → chunk-ATURDO2C.js} +12 -12
- package/dist/{chunk-ZHS2VQU7.js → chunk-B7WTHCTF.js} +3 -3
- package/dist/{chunk-LWFH5QTJ.js → chunk-BUHTLO2K.js} +1 -1
- package/dist/{chunk-EQ72AP5E.js → chunk-BYLGKRIT.js} +1 -1
- package/dist/{chunk-D5MN3LXC.js → chunk-C4T4APD6.js} +22 -22
- package/dist/{chunk-IFWXC323.js → chunk-CCA4LQNB.js} +1 -1
- package/dist/{chunk-Y4RHGLXB.js → chunk-CFJL6MML.js} +1 -1
- package/dist/{chunk-UHGAT5MH.js → chunk-CJ4U4C4A.js} +5 -5
- package/dist/{chunk-TZXAW32T.js → chunk-CRILBBSU.js} +1 -1
- package/dist/{chunk-D4RVWSUT.js → chunk-CRO56LVN.js} +1 -1
- package/dist/{chunk-DHMOJX2Z.js → chunk-D7DRZKUI.js} +1 -1
- package/dist/{chunk-6S6FJJKP.js → chunk-DD2ZGHCG.js} +6 -6
- package/dist/{chunk-GJFTO7D4.js → chunk-DSKROZST.js} +1 -1
- package/dist/{chunk-LP45EML2.js → chunk-DV4B26FJ.js} +1 -1
- package/dist/{chunk-P75N466Z.js → chunk-DW5Y57I2.js} +2 -2
- package/dist/{chunk-CAIKDX2M.js → chunk-DWYCSJ6O.js} +2 -2
- package/dist/{chunk-7A2Y3W55.js → chunk-E47TNYYE.js} +1 -1
- package/dist/{chunk-IIKPM3F4.js → chunk-ED5D2O6E.js} +1 -1
- package/dist/{chunk-HGMQOHMK.js → chunk-EFBWQWUS.js} +1 -1
- package/dist/chunk-EJBR5Y4X.js +9 -0
- package/dist/{chunk-AO7XAAGG.js → chunk-EM6VZSNJ.js} +1 -1
- package/dist/{chunk-ZA2RBNRA.js → chunk-EO3IKZCP.js} +1 -1
- package/dist/chunk-EZBE3H2W.js +9 -0
- package/dist/{chunk-PMKBWDXO.js → chunk-FGWHTNC3.js} +1 -1
- package/dist/{chunk-UOGF37Z4.js → chunk-GCRPI3AL.js} +1 -1
- package/dist/{chunk-DMBA6KYQ.js → chunk-GEQC4ABV.js} +6 -6
- package/dist/{chunk-T74FGTLW.js → chunk-GHMDLZH4.js} +7 -7
- package/dist/chunk-GWDTGCQB.js +9 -0
- package/dist/{chunk-VEATEVMV.js → chunk-H34KI3HV.js} +9 -9
- package/dist/{chunk-LXQHTY3A.js → chunk-H3IGNWT7.js} +3 -3
- package/dist/{chunk-VZ52KKNA.js → chunk-HCKCQIWA.js} +6 -6
- package/dist/{chunk-I5GDAQYL.js → chunk-HK4QAI2A.js} +2 -2
- package/dist/{chunk-FD6XZRWA.js → chunk-HKPVHSZ3.js} +1 -1
- package/dist/{chunk-GS74BABV.js → chunk-HNUKXGYP.js} +1 -1
- package/dist/{chunk-B2AYI45X.js → chunk-HTB5AEZU.js} +6 -6
- package/dist/chunk-IJXMWWTM.js +9 -0
- package/dist/{chunk-AWQ5SOC5.js → chunk-IK37Q6LY.js} +1 -1
- package/dist/{chunk-TTQJQKCE.js → chunk-IS7C6OWZ.js} +8 -8
- package/dist/{chunk-YQLKZ5UQ.js → chunk-JAQO3TNE.js} +1 -1
- package/dist/chunk-JINTE3G4.js +1 -0
- package/dist/{chunk-SKRFI6WB.js → chunk-JQHL4B4C.js} +12 -12
- package/dist/{chunk-5IESW4PM.js → chunk-JSUL7UON.js} +5 -5
- package/dist/{chunk-KV4QPU6U.js → chunk-K46DLEIX.js} +21 -21
- package/dist/{chunk-LXBBJNBQ.js → chunk-KABXUBIH.js} +1 -1
- package/dist/{chunk-CR3YDABU.js → chunk-KRH7UAD2.js} +1 -1
- package/dist/{chunk-PDFV3YQB.js → chunk-KSHNA6W2.js} +1 -1
- package/dist/{chunk-4JJ5WT4D.js → chunk-L6OPXIZN.js} +1 -1
- package/dist/{chunk-ZKBGUDNB.js → chunk-LBGRLG3Y.js} +1 -1
- package/dist/{chunk-PL4HKGYP.js → chunk-LISPTWW3.js} +1 -1
- package/dist/{chunk-HJBR73GS.js → chunk-LJN77RG6.js} +1 -1
- package/dist/chunk-LPJGF6LK.js +27 -0
- package/dist/{chunk-M4AOQYSP.js → chunk-LXHTCLNX.js} +1 -1
- package/dist/chunk-MBY5JIGB.js +1 -0
- package/dist/{chunk-L2IPWMLI.js → chunk-MOBJVNLF.js} +10 -10
- package/dist/{chunk-R6TDZ7T5.js → chunk-MQXZZBR6.js} +1 -1
- package/dist/{chunk-UCAMOW53.js → chunk-MSAQGUGU.js} +4 -4
- package/dist/{chunk-K3IUUZO5.js → chunk-N7GFQZ2J.js} +8 -8
- package/dist/chunk-N7LDQZTL.js +8 -0
- package/dist/{chunk-CR42APAY.js → chunk-NDP2I5HK.js} +6 -6
- package/dist/{chunk-VVDK7XPH.js → chunk-NIBYHQLT.js} +1 -1
- package/dist/{chunk-KYHDDVTR.js → chunk-NK5RRBXY.js} +6 -6
- package/dist/{chunk-WEEQDPU3.js → chunk-NPTHHWXZ.js} +5 -5
- package/dist/chunk-NZISMTQE.js +7 -0
- package/dist/{chunk-VIDT4JLR.js → chunk-O53EQODF.js} +1 -1
- package/dist/{chunk-HT7SOOMD.js → chunk-OAZX7ZGB.js} +10 -10
- package/dist/{chunk-4EVYK6DR.js → chunk-OMCM3SIE.js} +4 -4
- package/dist/{chunk-WZJPASST.js → chunk-OMUC6TZT.js} +6 -6
- package/dist/{chunk-PETBAYS5.js → chunk-OXVRXWJL.js} +12 -12
- package/dist/{chunk-RBAC26J7.js → chunk-P75R4EYJ.js} +3 -3
- package/dist/{chunk-JJLAI6GL.js → chunk-PB6XGDLJ.js} +8 -8
- package/dist/{chunk-HDABS36W.js → chunk-PLDMQNKD.js} +7 -7
- package/dist/{chunk-6UJYRGWY.js → chunk-QMTYILTT.js} +1 -1
- package/dist/{chunk-5KKJAYKT.js → chunk-QTNMALBN.js} +1 -1
- package/dist/{chunk-ZMC25LRC.js → chunk-RBINX62X.js} +1 -1
- package/dist/{chunk-SAASFWKB.js → chunk-RDYFZHT3.js} +1 -1
- package/dist/{chunk-JRCFOZEU.js → chunk-RLTTAH46.js} +4 -4
- package/dist/{chunk-UTITWGVW.js → chunk-RPFONHXQ.js} +1 -1
- package/dist/{chunk-2XORVHF2.js → chunk-RSPCCVN4.js} +1 -1
- package/dist/{chunk-UVMM7AYO.js → chunk-S262RGL6.js} +1 -1
- package/dist/{chunk-NPT6EXHK.js → chunk-SCPPW3ZC.js} +1 -1
- package/dist/chunk-SOWRW647.js +6 -0
- package/dist/chunk-SZC35EYE.js +28 -0
- package/dist/{chunk-6CK44QWU.js → chunk-T4WDJ7IB.js} +29 -29
- package/dist/{chunk-7FCIFHO7.js → chunk-T6BGS26U.js} +1 -1
- package/dist/{chunk-O6VIHWYU.js → chunk-TF6DYDNQ.js} +1 -1
- package/dist/{chunk-JJZAYAVL.js → chunk-THSKCKAQ.js} +1 -1
- package/dist/{chunk-64KZ74CS.js → chunk-TLE6VHMJ.js} +7 -7
- package/dist/{chunk-3N2MNOV5.js → chunk-TOSUM2OI.js} +1 -1
- package/dist/{chunk-SEP35R2E.js → chunk-TVRKONNH.js} +1 -1
- package/dist/{chunk-LLSLY6BT.js → chunk-U24GFE5L.js} +1 -1
- package/dist/{chunk-6ETRVCMH.js → chunk-UDVUVFRS.js} +12 -12
- package/dist/{chunk-OMROEVOP.js → chunk-UIOKWFT4.js} +1 -1
- package/dist/{chunk-G3FHFWC2.js → chunk-UMFEOZ75.js} +3 -3
- package/dist/{chunk-N75MPMLD.js → chunk-UNJWYV6V.js} +2 -2
- package/dist/chunk-UYNFTF6L.js +2 -0
- package/dist/{chunk-AQ7CNPEE.js → chunk-VI4NLOVJ.js} +10 -10
- package/dist/{chunk-VU5P4ZM5.js → chunk-VNAOZVSM.js} +13 -13
- package/dist/{chunk-JFCCI5L2.js → chunk-VOXX4LNC.js} +1 -1
- package/dist/{chunk-RXVFAFEB.js → chunk-VPGQMNW3.js} +1 -1
- package/dist/{chunk-GRC46C4V.js → chunk-W4UYDSTI.js} +7 -7
- package/dist/{chunk-DXKXETTT.js → chunk-WPCNJ4UL.js} +1 -1
- package/dist/{chunk-LJJ7FDAQ.js → chunk-WRJP33DN.js} +2 -2
- package/dist/{chunk-NTUZT37J.js → chunk-WRRMZAKK.js} +4 -4
- package/dist/chunk-WVIUU4BZ.js +13 -0
- package/dist/{chunk-RMSF4UCJ.js → chunk-X3NYVMXJ.js} +1 -1
- package/dist/chunk-XNFZLSWW.js +7 -0
- package/dist/{chunk-FFNPAJLS.js → chunk-XZ2WQNOX.js} +9 -9
- package/dist/chunk-XZU24YKP.js +13 -0
- package/dist/{chunk-CXZ7PHHF.js → chunk-Y3SVPBUT.js} +6 -6
- package/dist/{chunk-YOXR3VKO.js → chunk-YAZENY3X.js} +1 -1
- package/dist/{chunk-FRH2AHPI.js → chunk-YESTUDOK.js} +1 -1
- package/dist/{chunk-SSM6P43S.js → chunk-YIV7CFBG.js} +2 -2
- package/dist/{chunk-BPJ3CQH7.js → chunk-YJOJ5MUZ.js} +11 -11
- package/dist/chunk-YN5K72D6.js +5 -0
- package/dist/chunk-YQEGMCSX.js +9 -0
- package/dist/{chunk-HJM4LSMM.js → chunk-YXOFUY4J.js} +1 -1
- package/dist/{chunk-6C6M3QXL.js → chunk-ZHFKBWBU.js} +1 -1
- package/dist/{chunk-SI33IE7G.js → chunk-ZITMPMUT.js} +2 -2
- package/dist/{chunk-XOH6QERF.js → chunk-ZKYBLZPT.js} +9 -9
- package/dist/{chunk-IUG4Z2ND.js → chunk-ZU3BD75E.js} +1 -1
- package/dist/{chunk-PVVHWLNX.js → chunk-ZU432XW4.js} +1 -1
- package/dist/{chunk-5UCRYSQJ.js → chunk-ZYDRBF3H.js} +5 -5
- package/dist/{chunk-2ZAFRGRF.js → chunk-ZYJAZ5HH.js} +1 -1
- package/dist/data/DataTable.js +1 -1
- package/dist/data/EntityList.js +1 -1
- package/dist/data/Kanban.js +1 -1
- package/dist/data/ListFooter.js +1 -1
- package/dist/data/ListLoadError.js +1 -1
- package/dist/data/Pagination.js +1 -1
- package/dist/data/ResizableTable.js +1 -1
- package/dist/file-intake/index.js +1 -1
- package/dist/forms/BorderInput.js +1 -1
- package/dist/forms/BrandAssetEditor.js +1 -1
- package/dist/forms/Calendar.js +1 -1
- package/dist/forms/ColorPicker.js +1 -1
- package/dist/forms/ComposerAttachments.js +1 -1
- package/dist/forms/CornersInput.js +1 -1
- package/dist/forms/DatePicker.js +1 -1
- package/dist/forms/DateRangePicker.js +1 -1
- package/dist/forms/DateTimePicker.js +1 -1
- package/dist/forms/DisplayChips.js +1 -1
- package/dist/forms/FilePicker.js +1 -1
- package/dist/forms/FormErrorSummary.js +1 -1
- package/dist/forms/IconPicker.js +1 -1
- package/dist/forms/ImageFocusPoint.js +1 -1
- package/dist/forms/Input.js +1 -1
- package/dist/forms/InputNumber.js +1 -1
- package/dist/forms/LinkPicker.js +1 -1
- package/dist/forms/MediaLibrary.js +1 -1
- package/dist/forms/MediaUploadField.js +1 -1
- package/dist/forms/MediaUploadGrid.js +1 -1
- package/dist/forms/MediaUsedInList.js +1 -1
- package/dist/forms/NumericKeypad.js +1 -1
- package/dist/forms/PositionInput.js +1 -1
- package/dist/forms/RenameField.js +1 -1
- package/dist/forms/Select.js +1 -1
- package/dist/forms/SidesInput.js +1 -1
- package/dist/forms/Slider.js +1 -1
- package/dist/forms/Snippet.js +1 -1
- package/dist/forms/SplitButton.js +1 -1
- package/dist/forms/TagInput.js +1 -1
- package/dist/forms/TextToolbar.js +1 -1
- package/dist/forms/TimePicker.js +1 -1
- package/dist/forms/WidthsBar.js +1 -1
- package/dist/forms/mediaLibraryMenu.js +1 -1
- package/dist/forms/mediaMoveItems.js +1 -1
- package/dist/forms/textAlign.js +1 -1
- package/dist/forms/useFileIntake.js +1 -1
- package/dist/icons/index.js +1 -1
- package/dist/index.js +523 -523
- package/dist/locales/zh-Hans.js +1 -1
- package/dist/map/index.js +3 -3
- package/dist/markdown/index.js +1 -1
- package/dist/page-tabs/index.js +5 -5
- package/dist/pdf/index.js +1 -1
- package/dist/shell/Accordion.js +1 -1
- package/dist/shell/AppUpdateBanner.js +1 -1
- package/dist/shell/Avatar.js +1 -1
- package/dist/shell/Banner.js +1 -1
- package/dist/shell/Breadcrumbs.js +1 -1
- package/dist/shell/BudgetBar.js +1 -1
- package/dist/shell/Card.js +1 -1
- package/dist/shell/ColoredBadge.js +1 -1
- package/dist/shell/ConfirmDialog.js +1 -1
- package/dist/shell/ContainerFillChart.js +1 -1
- package/dist/shell/ContextMenu.js +1 -1
- package/dist/shell/CountBadge.js +1 -1
- package/dist/shell/Dialog.js +1 -1
- package/dist/shell/Drawer.js +1 -1
- package/dist/shell/DropdownMenu.js +1 -1
- package/dist/shell/EditableGrid.js +1 -1
- package/dist/shell/EmptyState.js +1 -1
- package/dist/shell/GlobalSearch.js +1 -1
- package/dist/shell/HelpCenter.js +1 -1
- package/dist/shell/IconRail.js +1 -1
- package/dist/shell/ImageLightbox.js +1 -1
- package/dist/shell/ItemCount.js +1 -1
- package/dist/shell/LanguageSelect.js +1 -1
- package/dist/shell/Markdown.js +1 -1
- package/dist/shell/MetricBar.js +1 -1
- package/dist/shell/MetricBarLegend.js +1 -1
- package/dist/shell/MilestoneTimeline.js +1 -1
- package/dist/shell/PageHeader.js +1 -1
- package/dist/shell/PopupMenu.js +1 -1
- package/dist/shell/ProductionTimeline.js +1 -1
- package/dist/shell/ResizeHandle.js +1 -1
- package/dist/shell/Result.js +1 -1
- package/dist/shell/SearchableSelect.js +1 -1
- package/dist/shell/SettingReset.js +1 -1
- package/dist/shell/SettingRow.js +1 -1
- package/dist/shell/SidebarLayout.js +1 -1
- package/dist/shell/SidebarNav.js +1 -1
- package/dist/shell/SortableList.js +1 -1
- package/dist/shell/Statistic.js +1 -1
- package/dist/shell/StepChain.js +1 -1
- package/dist/shell/Stepper.js +1 -1
- package/dist/shell/TimeAgo.js +1 -1
- package/dist/shell/TimelineTrack.js +1 -1
- package/dist/shell/TopNav.js +1 -1
- package/dist/shell/TransferProgress.js +1 -1
- package/dist/shell/Tree.js +1 -1
- package/dist/shell/discardGuard.js +1 -1
- package/dist/shell/language.js +1 -1
- package/dist/shell/strings.d.ts +0 -265
- package/dist/shell/strings.js +1 -1
- package/dist/shell/toast.js +1 -1
- package/dist/shell.css +1 -12
- package/dist/telemetry/index.js +1 -1
- package/dist/templates/AuthScreen.js +1 -1
- package/dist/templates/ChatTemplate.js +1 -1
- package/dist/templates/CheckoutTemplate.js +1 -1
- package/dist/templates/DashboardTemplate.js +1 -1
- package/dist/templates/DataTablePage.js +1 -1
- package/dist/templates/EmailTemplate.js +1 -1
- package/dist/templates/ErrorBoundary.js +1 -1
- package/dist/templates/ErrorPage.js +1 -1
- package/dist/templates/FormLayoutPage.js +1 -1
- package/dist/templates/GalleryTemplate.js +1 -1
- package/dist/ui/index.js +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -8
- package/dist/Calculator-XUV5JV3O.js +0 -29
- package/dist/Documents-IRPS3N5T.js +0 -84
- package/dist/Files-VN2IOPHX.js +0 -88
- package/dist/PdfViewer-M4RTCNNE.js +0 -1
- package/dist/Sidebar-OZMJNAXN.js +0 -44
- package/dist/Spreadsheet-YQOVGIU7.js +0 -75
- package/dist/chunk-2E3K4FSQ.js +0 -13
- package/dist/chunk-2NRNKF46.js +0 -9
- package/dist/chunk-2XOH3NJZ.js +0 -27
- package/dist/chunk-5W3U3EVG.js +0 -7
- package/dist/chunk-5YP7MFPK.js +0 -1
- package/dist/chunk-7TVGP2SX.js +0 -8
- package/dist/chunk-AD27M3ZH.js +0 -9
- package/dist/chunk-CGA6RTVI.js +0 -9
- package/dist/chunk-EBGOENC3.js +0 -3
- package/dist/chunk-ES2LUEPN.js +0 -22
- package/dist/chunk-FZWSP7KJ.js +0 -28
- package/dist/chunk-IKKR2TYY.js +0 -9
- package/dist/chunk-KU4IWX6F.js +0 -2
- package/dist/chunk-L74WV4RJ.js +0 -6
- package/dist/chunk-MD6EPKOR.js +0 -11
- package/dist/chunk-MFP5KOQW.js +0 -9
- package/dist/chunk-Q7UTGO73.js +0 -11
- package/dist/chunk-QDL2FNP7.js +0 -8
- package/dist/chunk-R7KRBKFH.js +0 -5
- package/dist/chunk-UBQUXUD2.js +0 -7
- package/dist/chunk-UZTKBA7Z.js +0 -13
- package/dist/chunk-VTVSMRFX.js +0 -1
- package/dist/chunk-YXSGMPNW.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{railLabelsShown as e}from"./chunk-FQEALPZJ.js";import{CountBadge as t}from"./chunk-
|
|
1
|
+
import{railLabelsShown as e}from"./chunk-FQEALPZJ.js";import{CountBadge as t}from"./chunk-NIBYHQLT.js";import{Tooltip as n}from"./chunk-NJN5IKWO.js";import{useBrowserLayoutEffect as r}from"./chunk-D65T4H6J.js";import{createContext as o,useRef as a,useState as i,useEffect as l,useContext as s}from"react";import{jsx as c,jsxs as d,Fragment as u}from"react/jsx-runtime";var h=o({labels:"none",shown:"none"}),f="button[data-icon-rail-button]:not([disabled])";function b(e,t,n){const r=getComputedStyle(e),o=(parseFloat(r.paddingLeft)||0)+(parseFloat(r.paddingRight)||0)+(parseFloat(r.borderLeftWidth)||0)+(parseFloat(r.borderRightWidth)||0),a="horizontal"===t?(parseFloat(r.columnGap)||0)*Math.max(0,n-1):0,i=e.parentElement;let l=1/0;if(i){const e=getComputedStyle(i);l=i.clientWidth-(parseFloat(e.paddingLeft)||0)-(parseFloat(e.paddingRight)||0)}return{chrome:o+a,room:l}}function m({"aria-label":t,orientation:n="vertical",children:o,className:s="",labels:d="none",labelsFit:u=!1,onLabelsShown:m}){const p=a(null),g="none"!==d&&u,[v,y]=i(null),w="none"===d?"none":g?v??"none":"all",x=a(()=>{});x.current=()=>{const t=p.current;if(!t||!g)return;const r=function(e,t){return[...e.querySelectorAll("button[data-icon-rail-button]")].map(e=>{const n=getComputedStyle(e),r=(parseFloat(n.paddingLeft)||0)+(parseFloat(n.paddingRight)||0)+(parseFloat(n.borderLeftWidth)||0)+(parseFloat(n.borderRightWidth)||0),o=parseFloat(n.minWidth)||0,a=e.querySelector("[data-icon-rail-glyph]")?.getBoundingClientRect().width??0,i=e.querySelector("[data-icon-rail-word]")?.scrollWidth??0;return{bare:Math.max(o,r+a),worded:"below"===t?Math.max(o,r+Math.max(a,i)):Math.max(o,r+a+8+i),active:"true"===e.getAttribute("aria-pressed")}})}(t,d);y(e({buttons:r,orientation:n,...b(t,n,r.length)}))},r(()=>{x.current()}),l(()=>{const e=p.current?.parentElement;if(!g||!e)return;let t=!0;const n=()=>{t&&x.current()},r="undefined"==typeof ResizeObserver?void 0:ResizeObserver,o=r?new r(n):null;return o?.observe(e),document.fonts?.ready.then(n,()=>{}),()=>{t=!1,o?.disconnect()}},[g]);const F=a(null),k=a(m);k.current=m,l(()=>{g&&null!==v&&F.current!==v&&(F.current=v,k.current?.(v))},[g,v]),r(()=>{const e=p.current;if(!e)return;const t=[...e.querySelectorAll(f)];if(0===t.length)return;const n=t.find(e=>e===document.activeElement)??t.find(e=>"true"===e.getAttribute("aria-pressed"))??t[0];for(const t of e.querySelectorAll("button[data-icon-rail-button]"))t.tabIndex=t===n?0:-1});/* @__PURE__ */
|
|
2
2
|
return c("div",{ref:p,role:"toolbar","aria-label":t,"aria-orientation":n,"data-orientation":n,onKeyDown:e=>{const t=p.current;if(!t)return;const r=[...t.querySelectorAll(f)],o=r.indexOf(e.target);if(o<0)return;const a="vertical"===n?"ArrowUp":"ArrowLeft",i="vertical"===n?"ArrowDown":"ArrowRight",l=e.key===i?(o+1)%r.length:e.key===a?(o-1+r.length)%r.length:"Home"===e.key?0:"End"===e.key?r.length-1:-1;if(!(l<0)){e.preventDefault();for(const e of r)e.tabIndex=e===r[l]?0:-1;r[l].focus()}},"data-labels":"none"===d?void 0:d,"data-labels-shown":"none"===d?void 0:w,className:`flex gap-1 ${"vertical"===n?"flex-col items-center":"flex-row items-center"} ${s}`.trim(),children:/* @__PURE__ */c(h.Provider,{value:{labels:d,shown:w},children:o})})}function p({label:e,icon:r,active:o,disabled:a,onClick:i,badge:l,tooltipSide:f="right",className:b=""}){const m=!0===o,{labels:p,shown:g}=s(h),v=void 0===l||!1===l||0===l?r:/* @__PURE__ */c(t,{count:"number"==typeof l?l:void 0,dot:!0===l,max:99,children:r}),y="none"!==p,w=y&&("all"===g||"chosen"===g&&m),x=/* @__PURE__ */c("button",{type:"button","data-icon-rail-button":"","aria-label":e,"aria-pressed":"boolean"==typeof o?o:void 0,disabled:a,onClick:a?void 0:i,className:[`relative inline-flex ${y?"beside"===p?"h-9 min-w-9 justify-center px-2":"min-h-9 min-w-9 flex-col justify-center px-1 py-1":"h-9 w-9 justify-center"} shrink-0 items-center rounded-lg transition-colors`,"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]","disabled:cursor-not-allowed disabled:opacity-40",m?"bg-accent-tint text-blue-700":"text-gray-600 not-disabled:not-aria-disabled:hover:bg-gray-100 not-disabled:not-aria-disabled:hover:text-ink-strongest",b].filter(Boolean).join(" "),children:y?/* @__PURE__ */d(u,{children:[
|
|
3
3
|
/* @__PURE__ */c("span",{"data-icon-rail-glyph":"",className:"inline-flex shrink-0 items-center justify-center",children:v}),
|
|
4
4
|
/* @__PURE__ */c("span",{"data-icon-rail-word":"","aria-hidden":"true",className:["overflow-hidden whitespace-nowrap text-xs font-medium leading-none",w?"beside"===p?"ml-2":"mt-1":"max-h-0 max-w-0"].join(" "),children:e})]}):v});/* @__PURE__ */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{CHART_INK as r}from"./chunk-TZFACUMR.js";import{useShellStrings as t}from"./chunk-
|
|
1
|
+
import{CHART_INK as r}from"./chunk-TZFACUMR.js";import{useShellStrings as t}from"./chunk-MBY5JIGB.js";import{useId as e}from"react";import{jsx as i,jsxs as s}from"react/jsx-runtime";function o({height:o=220,width:a=720,variant:h="area",bars:l=9,label:c,className:n}){const f=t().charts,p=c??f.loading,d=`${e()}-shimmer`,m=48,g=a-16,y=12,u=o-26;/* @__PURE__ */
|
|
2
2
|
return i("div",{className:n,children:/* @__PURE__ */s("svg",{width:"100%",height:o,viewBox:`0 0 ${a} ${o}`,role:"img","aria-label":p,"aria-busy":"true",children:[
|
|
3
3
|
/* @__PURE__ */i("defs",{children:/* @__PURE__ */s("linearGradient",{id:d,x1:"0",y1:"0",x2:"1",y2:"0",children:[
|
|
4
4
|
/* @__PURE__ */i("stop",{offset:"0%",stopColor:r.surface,stopOpacity:"0"}),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{SidebarLayout as e}from"./chunk-
|
|
1
|
+
import{SidebarLayout as e}from"./chunk-DD2ZGHCG.js";import{Avatar as t}from"./chunk-TVRKONNH.js";import{Input_default as a}from"./chunk-HNUKXGYP.js";import{Button_default as i}from"./chunk-EOVXFXVV.js";import{useState as s}from"react";import{jsx as n,jsxs as l}from"react/jsx-runtime";var r=[{id:1,name:"Priya Patel",last:"Sounds good — shipping it now",time:"9:41",status:"online"},{id:2,name:"Design team",last:"Marco: updated the tokens",time:"9:12",status:"away"},{id:3,name:"Tom Becker",last:"Thanks!",time:"Yest",status:"offline"},{id:4,name:"Sara Lind",last:"See you Friday 🎉",time:"Yest",status:"busy"}],m=[{mine:!1,text:"Hey! Did the latest build go out?"},{mine:!0,text:"Just merged — deploying now."},{mine:!1,text:"Nice. Any breaking changes for the portal?"},{mine:!0,text:"Nope, fully additive. New components only."},{mine:!1,text:"Sounds good — shipping it now"}];function d(){const[d,o]=s(1),c=r.find(e=>e.id===d)??r[0];/* @__PURE__ */
|
|
2
2
|
return n("div",{className:"h-full",children:/* @__PURE__ */n(e,{side:"left",defaultWidth:260,sidebar:/* @__PURE__ */n("div",{className:"h-full overflow-auto",children:r.map(e=>/* @__PURE__ */l("button",{onClick:()=>o(e.id),className:"flex w-full items-center gap-3 border-b border-gray-100 px-3 py-3 text-left hover:bg-gray-50 "+(e.id===d?"bg-blue-50/50":""),children:[
|
|
3
3
|
/* @__PURE__ */n(t,{name:e.name,status:e.status}),
|
|
4
4
|
/* @__PURE__ */l("div",{className:"min-w-0 flex-1",children:[
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Icon as e}from"./chunk-
|
|
1
|
+
import{Icon as e}from"./chunk-2UO47XB4.js";import{SpinnerRing as t}from"./chunk-R2VKEMZH.js";import{useState as a,useId as r,Children as s,isValidElement as i}from"react";import{jsx as n,jsxs as l}from"react/jsx-runtime";function c({summary:t,busy:c=!1,open:o,onOpenChange:d,label:m="Steps",className:u="",children:p}){const[f,h]=a(null),g=r(),x=o??f??c;return 1===s.toArray(p).filter(i).length?/* @__PURE__ */n("div",{className:`text-xs text-gray-500 ${u}`.trim(),children:/* @__PURE__ */n("ol",{"aria-label":m,children:p})}):/* @__PURE__ */l("div",{className:`text-xs text-gray-500 ${u}`.trim(),children:[
|
|
2
2
|
/* @__PURE__ */l("button",{type:"button",onClick:()=>{h(!x),d?.(!x)},"aria-expanded":x,"aria-controls":x?g:void 0,className:"flex w-full items-center gap-2 rounded text-left hover:text-gray-700 focus-visible:outline focus-visible:outline-2 focus-visible:outline-blue-600",children:[
|
|
3
3
|
/* @__PURE__ */n(e,{name:"chevron-right",size:12,className:"shrink-0 motion-safe:transition-transform "+(x?"rotate-90":"")}),
|
|
4
4
|
/* @__PURE__ */n("span",{"aria-live":"polite",className:"min-w-0 flex-1 truncate",children:t})]}),x&&/* @__PURE__ */n("ol",{id:g,"aria-label":m,className:"mt-2 ml-2 space-y-2 border-l border-gray-200 pl-3",children:p})]})}var o={pending:"text-gray-400",active:"text-gray-800",complete:"text-gray-600",failed:"text-red-600",stopped:"text-gray-500",waiting:"text-amber-700",skipped:"text-gray-400"},d={pending:"Pending",active:"In progress",complete:"Done",failed:"Failed",stopped:"Stopped",waiting:"Waiting for you",skipped:"Skipped"};function m({status:a}){switch(a){case"active":/* @__PURE__ */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{resolveSeriesColor as t,CHART_INK as e}from"./chunk-TZFACUMR.js";import{useShellStrings as r}from"./chunk-
|
|
2
|
-
return n("rect",{x:y(e)-4.5,y:0,width:9,height:u,rx:3,fill:v,className:"cursor-ew-resize rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",tabIndex:0,role:"slider","aria-label":"from"===t?d.windowStart:d.windowEnd,"aria-valuemin":0,"aria-valuemax":p,"aria-valuenow":e,"aria-valuetext":a[e],style:{touchAction:"none"},onKeyDown:
|
|
1
|
+
import{resolveSeriesColor as t,CHART_INK as e}from"./chunk-TZFACUMR.js";import{useShellStrings as r}from"./chunk-MBY5JIGB.js";import{useRef as o}from"react";import{jsx as n,jsxs as i}from"react/jsx-runtime";function a({labels:a,data:l,range:h,onRangeChange:c,height:u=46,width:s=720,color:f,className:m}){const d=r().charts,g=o(null),p=a.length-1,[w,x]=h,v=f??t(0),y=t=>0===p?0:t/p*s,M=t=>"number"==typeof t&&Number.isFinite(t),$=l.filter(M),b=Math.max(...$,1),k=t=>u-t/b*(u-6),D=[];a.forEach((t,e)=>{if(!M(l[e]))return;const r=D[D.length-1];r&&r.to===e-1?r.to=e:D.push({from:e,to:e})});const F=D.map(t=>{const e=[];for(let r=t.from;r<=t.to;r+=1)e.push(`${r===t.from?"M":"L"}${y(r).toFixed(2)},${k(l[r]).toFixed(2)}`);return`${e.join(" ")} L${y(t.to).toFixed(2)},${u} L${y(t.from).toFixed(2)},${u} Z`}).join(" "),j=(t,e)=>{const r=Math.max(0,Math.min(p,e));c("from"===t?[Math.min(r,x-1),x]:[w,Math.max(r,w+1)])},C=t=>e=>{const r=e.shiftKey?5:1,o="from"===t?w:x;"ArrowLeft"===e.key&&(e.preventDefault(),j(t,o-r)),"ArrowRight"===e.key&&(e.preventDefault(),j(t,o+r)),"Home"===e.key&&(e.preventDefault(),j(t,0)),"End"===e.key&&(e.preventDefault(),j(t,p))},P=o(null),A=t=>e=>{P.current=t,e.currentTarget.setPointerCapture(e.pointerId)},B=t=>e=>{P.current===t&&j(t,(t=>{const e=g.current?.getBoundingClientRect();if(!e||0===e.width)return w;const r=Math.max(0,Math.min(1,(t-e.left)/e.width));return Math.round(r*p)})(e.clientX))},L=t=>()=>{P.current===t&&(P.current=null)},N=t=>{const e="from"===t?w:x;/* @__PURE__ */
|
|
2
|
+
return n("rect",{x:y(e)-4.5,y:0,width:9,height:u,rx:3,fill:v,className:"cursor-ew-resize rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",tabIndex:0,role:"slider","aria-label":"from"===t?d.windowStart:d.windowEnd,"aria-valuemin":0,"aria-valuemax":p,"aria-valuenow":e,"aria-valuetext":a[e],style:{touchAction:"none"},onKeyDown:C(t),onPointerDown:A(t),onPointerMove:B(t),onPointerUp:L(t),onPointerCancel:L(t)},t)};/* @__PURE__ */
|
|
3
3
|
return n("div",{className:m,children:/* @__PURE__ */i("svg",{ref:g,width:"100%",height:u,viewBox:`0 0 ${s} ${u}`,role:"group","aria-label":d.window(a[w],a[x],a.length),children:[
|
|
4
|
-
/* @__PURE__ */n("path",{d:
|
|
4
|
+
/* @__PURE__ */n("path",{d:F,fill:e.grid}),
|
|
5
5
|
/* @__PURE__ */n("rect",{x:0,y:0,width:y(w),height:u,fill:e.surface,fillOpacity:.72}),
|
|
6
6
|
/* @__PURE__ */n("rect",{x:y(x),y:0,width:Math.max(0,s-y(x)),height:u,fill:e.surface,fillOpacity:.72}),
|
|
7
|
-
/* @__PURE__ */n("rect",{x:y(w),y:0,width:Math.max(1,y(x)-y(w)),height:u,fill:"none",stroke:v,strokeWidth:1}),
|
|
7
|
+
/* @__PURE__ */n("rect",{x:y(w),y:0,width:Math.max(1,y(x)-y(w)),height:u,fill:"none",stroke:v,strokeWidth:1}),N("from"),N("to")]})})}export{a as ChartBrush};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{optionNoteClass as e}from"./chunk-URHGHXDN.js";import{DEFAULT_SHELL_STRINGS as n,useShellStrings as o}from"./chunk-
|
|
1
|
+
import{optionNoteClass as e}from"./chunk-URHGHXDN.js";import{DEFAULT_SHELL_STRINGS as n,useShellStrings as o}from"./chunk-MBY5JIGB.js";import{jsxs as t,jsx as a}from"react/jsx-runtime";function l(n){const o=n.depth?{paddingInlineStart:16*n.depth+"px"}:{};/* @__PURE__ */
|
|
2
2
|
return t("span",{"data-move-target":"",className:"flex min-w-0 flex-col",style:o,children:[
|
|
3
3
|
/* @__PURE__ */a("span",{children:n.label}),n.disabledReason&&/* @__PURE__ */a("span",{className:e(),children:n.disabledReason})]})}function r({count:e,kind:o="file",targets:t,onPick:a},r=n.media){const i=[{type:"label",key:"move-to",label:r.moveTo(e,o)}];if(!t.length)return i.push({type:"status",key:"move-nowhere",label:r.moveNowhere}),i;let s;return t.forEach((e,n)=>{(n>0&&e.group!==s||0===n&&e.group)&&(n>0&&i.push({type:"divider",key:`group-line:${n}`}),e.group&&i.push({type:"label",key:`group:${n}`,label:e.group})),s=e.group,i.push({key:e.key,label:l(e),disabled:!!e.disabledReason,onSelect:()=>a(e)})}),i}function i(e,o=n.media){const{head:t=!0,icon:a,disabled:l,key:i="move-to-menu",...s}=e,u=r(s,o);return{type:"submenu",key:i,label:o.moveToMenu,icon:a,disabled:l,maxHeight:320,items:t?u:u.slice(1)}}function s(e){return r(e,o().media)}export{r as mediaMoveItems,i as mediaMoveSubmenu,s as useMediaMoveItems};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Icon as e}from"./chunk-
|
|
1
|
+
import{Icon as e}from"./chunk-2UO47XB4.js";import{DEFAULT_SHELL_STRINGS as t}from"./chunk-MBY5JIGB.js";import{jsx as r}from"react/jsx-runtime";var n=["left","center","right","justify"],a={left:"align-left",center:"align-center",right:"align-right",justify:"align-justify"};function i(t){switch(t){case"left":/* @__PURE__ */
|
|
2
2
|
return r(e,{name:"align-left"});case"center":/* @__PURE__ */
|
|
3
3
|
return r(e,{name:"align-center"});case"right":/* @__PURE__ */
|
|
4
4
|
return r(e,{name:"align-right"});case"justify":/* @__PURE__ */
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{ShellStringsProvider as t}from"./chunk-
|
|
1
|
+
import{ShellStringsProvider as t}from"./chunk-MBY5JIGB.js";import{createContext as e,useEffect as a,useCallback as n,useMemo as r,useContext as l}from"react";import{jsx as o}from"react/jsx-runtime";var g={tag:"en",name:"English",locale:null},c="react-os-shell:language",u=t=>"string"==typeof t?t:t.tag;function i(t){try{const e=new Intl.Locale(t).maximize();return{language:e.language,script:e.script}}catch{return null}}function s(t,e){const a=e.map(u),n=t.toLowerCase(),r=a.find(t=>t.toLowerCase()===n);if(r)return r;const l=i(t);if(!l)return;const o=a.map(t=>({tag:t,parts:i(t)})).filter(t=>t.parts?.language===l.language);return(o.find(t=>t.parts?.script===l.script)??o[0])?.tag}function f(){try{return globalThis.localStorage?.getItem(c)??null}catch{return null}}function m(t){try{return globalThis.localStorage?.setItem(c,t),globalThis.localStorage?.getItem(c)===t}catch{return!1}}function h({offered:t,fallback:e,saved:a=f(),preferred:n=globalThis.navigator?.languages??[]}){const r=e??(t.length>0?u(t[0]):g.tag);if(a){const e=s(a,t);if(e)return e}for(const e of n){const a=s(e,t);if(a)return a}return r}var d=e({language:g.tag,languages:[g],setLanguage:async()=>{}}),p=()=>globalThis.location?.reload();function b({languages:e,language:l,strings:g,onChange:c,reload:u=p,children:i}){const s=e.find(t=>t.tag===l),f=s?void 0===s.locale?s.tag:s.locale??void 0:void 0;a(()=>{const t=globalThis.document?.documentElement;if(!t)return;const e=t.getAttribute("lang");return t.setAttribute("lang",l),()=>{null===e?t.removeAttribute("lang"):t.setAttribute("lang",e)}},[l]);const h=n(async t=>{if(t!==l&&e.some(e=>e.tag===t)){m(t);try{await(c?.(t))}catch{}u&&u()}},[l,e,c,u]),b=r(()=>({language:l,languages:e,setLanguage:h}),[l,e,h]);/* @__PURE__ */
|
|
2
2
|
return o(d.Provider,{value:b,children:/* @__PURE__ */o(t,{value:g,locale:f,children:i})})}function v(){return l(d)}export{g as ENGLISH,c as SHELL_LANGUAGE_STORAGE_KEY,b as ShellLanguageProvider,s as matchShellLanguage,f as readSavedShellLanguage,h as resolveShellLanguage,m as saveShellLanguage,v as useShellLanguage};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Icon as e}from"./chunk-
|
|
1
|
+
import{Icon as e}from"./chunk-2UO47XB4.js";import{Tooltip as t}from"./chunk-NJN5IKWO.js";import{useShellStrings as n}from"./chunk-MBY5JIGB.js";import{useId as i}from"react";import{jsx as a,jsxs as r}from"react/jsx-runtime";var l=['input:not([disabled]):not([type="hidden"])',"select:not([disabled])","textarea:not([disabled])","button:not([disabled]):not(.es-default-reset)",'[tabindex]:not([tabindex="-1"])'].join(", "),s=e=>l.split(", ").map(t=>`${e} ${t}`).join(", ");function o({label:o,onReset:d,changed:c=!0,view:u="desktop",detail:b,name:p,tip:m,defaultAction:h,disabled:f,className:k}){const j=n().settingView,N=i(),y=["es-default-reset"];if(c&&y.push("is-changed"),k&&y.push(k),!c&&h)return y.push("is-pressable"),/* @__PURE__ */a(t,{content:h.title,children:/* @__PURE__ */a("button",{type:"button",className:y.join(" "),"aria-label":h.title,disabled:f,onClick:h.onPress,children:h.icon})});if(!c)/* @__PURE__ */return a("span",{className:y.join(" "),"aria-hidden":"true"});const x="desktop"===u,g=p??(x?j.resetName(o):j.inheritName(o)),T=b?j.backTo(b):x?j.backToDefault:j.backToAuto,q=m??(b?j.tip(g,T):g);
|
|
2
2
|
/* @__PURE__ */
|
|
3
3
|
return r(t,{content:q,describe:!1,children:[
|
|
4
4
|
/* @__PURE__ */a("button",{type:"button",className:y.join(" "),"aria-label":g,"aria-describedby":N,disabled:f,onClick:e=>{d(),function(e){const t=e.currentTarget,n=t.closest(".es-field");let i=n?.querySelector(s(".es-field-ctl"))??n?.querySelector(s(".es-field-head"))??null,a=n?null:t.parentElement;for(let e=0;!i&&a&&e<4;e+=1,a=a.parentElement)i=[...a.querySelectorAll(l)].find(e=>e!==t&&!e.closest('[aria-hidden="true"]'))??null;i?.focus()}(e)},children:/* @__PURE__ */a(e,{name:"revert",size:15,"aria-hidden":"true"})}),
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{TEXT_ALIGNS as e,textAlignWords as l,textAlignIcon as r}from"./chunk-RSPCCVN4.js";import{IconButton_default as a}from"./chunk-LE5LWALR.js";import{Icon as o}from"./chunk-2UO47XB4.js";import{Tooltip as n}from"./chunk-NJN5IKWO.js";import{useShellStrings as s}from"./chunk-MBY5JIGB.js";import{jsx as i,jsxs as t,Fragment as d}from"react/jsx-runtime";var c=e=>e.preventDefault(),u=e=>null!=e&&!1!==e,h=["bold","italic","underline","strike","link","sup","sub","code"];function p(e,l,r){const a={ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1,Home:"first",End:"last"}[e.key];if(void 0===a||0===l.length)return;const o=[...e.currentTarget.querySelectorAll('[role="radio"]')],n=o.findIndex(l=>l===e.target||l.contains(e.target));if(n<0)return;e.preventDefault();const s=o.length,i="first"===a?0:"last"===a?s-1:(n+a+s)%s;o[i].disabled||(r(l[i]),o[i].focus())}function b(e,l){const r=["bold","italic","underline","strike"].filter(l=>e.has(l)).length;return{color:r,link:r+(l?1:0)}}function m(e,l,r,a){const o=h.filter(l=>"link"!==l&&e.has(l)).length+(l?1:0);return r&&0!==o?a>0?"paragraph":"words":null}function w({offered:l,color:r,last:a,alignment:o,list:n,letterCase:s,clear:i}){let t=h.filter(e=>l.has(e)).length+(r?1:0)+(u(a)?1:0),d=(o?e.filter(e=>o.allow.includes(e)).length:0)+(n&&l.has("bullet")?1:0)+(n&&l.has("number")?1:0)+(l.has("quote")?1:0)+(s?3:0);const c=m(l,r,i,d);return"paragraph"===c&&(d+=1),"words"===c&&(t+=1),{words:t>0,paragraph:d>0,oneRow:t>0&&d>0&&t+1+d<=9,flow:t>0&&d>0&&t+1+d>9&&t<=7,cells:{words:t,paragraph:d}}}function g(e,l){/* @__PURE__ */
|
|
2
|
+
return i(n,{content:e,children:l},l.key??void 0)}function f({offered:n,pressed:h,onMark:f,color:k,linkOpen:v=!1,last:N,alignment:C,list:M,letterCase:D,clear:x,disabled:y=!1,"aria-label":B,windows:L,className:j="",layout:A="grid"}){const I=s().textToolbar,R=w({offered:n,color:k,last:N,alignment:C,list:M,letterCase:D,clear:x});if(!R.words&&!R.paragraph)return null;const q=m(n,k,x,R.cells.paragraph),S=(e,l="")=>`rosh-tb-btn${e?" is-on":""}${l?` ${l}`:""}`,$=(e,l,r,o)=>n.has(e)?g(l,/* @__PURE__ */i(a,"link"===e?{pressed:v,className:S(v),"aria-label":l,"aria-haspopup":"dialog","aria-expanded":v,"aria-keyshortcuts":o,disabled:y,onMouseDown:c,onClick:()=>f(e),children:r}:{className:S(Boolean(h[e])),"aria-label":l,"aria-pressed":Boolean(h[e]),"aria-keyshortcuts":o,disabled:y,onMouseDown:c,onClick:()=>f(e),children:r},e)):null,K=l(I),U=e.map(e=>[e,K[e],r(e)]),O=C?e.filter(e=>C.allow.includes(e)):[],T=C&&O.includes(C.value)?C.value:O[0],E=[["none",I.caseNone,/* @__PURE__ */i(o,{name:"case-normal"})],["upper",I.caseUpper,/* @__PURE__ */i(o,{name:"case-upper"})],["lower",I.caseLower,/* @__PURE__ */i(o,{name:"case-lower"})]],J=x&&q?g(I.clear,/* @__PURE__ */i(a,{className:S(!1),"aria-label":I.clear,disabled:y,onMouseDown:c,onClick:x.onClear,children:/* @__PURE__ */i(o,{name:"revert"})},"clear")):null,W=/* @__PURE__ */t(d,{children:[$("bold",I.bold,/* @__PURE__ */i(o,{name:"bold"}),"Meta+B"),$("italic",I.italic,/* @__PURE__ */i(o,{name:"italic"}),"Meta+I"),$("underline",I.underline,/* @__PURE__ */i(o,{name:"underline"}),"Meta+U"),$("strike",I.strike,/* @__PURE__ */i(o,{name:"strike"})),k?g(I.color,/* @__PURE__ */i(a,{pressed:k.open,className:S(k.open,"rosh-tb-color"),"aria-label":I.color,"aria-haspopup":"dialog","aria-expanded":k.open,disabled:y,style:k.run?{"--rosh-tb-run":k.run}:void 0,onMouseDown:c,onClick:k.onToggle,children:/* @__PURE__ */i(o,{name:"text-color"})},"color")):null,$("link",I.link,/* @__PURE__ */i(o,{name:"link"}),"Meta+K"),$("sup",I.sup,/* @__PURE__ */i(o,{name:"superscript"})),$("sub",I.sub,/* @__PURE__ */i(o,{name:"subscript"})),$("code",I.code,/* @__PURE__ */i(o,{name:"code"})),u(N)?N:null,"words"===q?J:null]}),G=/* @__PURE__ */t(d,{children:[C&&O.length>0?/* @__PURE__ */i("div",{className:"rosh-tb-group",role:"radiogroup","aria-label":I.alignment,onKeyDown:e=>p(e,O,e=>C.onChange(e)),children:U.map(([e,l,r])=>C.allow.includes(e)?g(l,/* @__PURE__ */i(a,{role:"radio",pressed:C.value===e,className:S(C.value===e),"aria-checked":C.value===e,"aria-label":l,tabIndex:e===T?0:-1,disabled:y||C.disabled,onMouseDown:c,onClick:()=>C.onChange(e),children:r},e)):null)}):null,M&&n.has("bullet")?g(I.bullet,/* @__PURE__ */i(a,{className:S("bullet"===M.pressed),"aria-label":I.bullet,"aria-pressed":"bullet"===M.pressed,disabled:y,onMouseDown:c,onClick:()=>M.onList("bullet"),children:/* @__PURE__ */i(o,{name:"list"})},"bullet")):null,M&&n.has("number")?g(I.number,/* @__PURE__ */i(a,{className:S("number"===M.pressed),"aria-label":I.number,"aria-pressed":"number"===M.pressed,disabled:y,onMouseDown:c,onClick:()=>M.onList("number"),children:/* @__PURE__ */i(o,{name:"numbered-list"})},"number")):null,$("quote",I.quote,/* @__PURE__ */i(o,{name:"quote"})),D?/* @__PURE__ */i("div",{className:"rosh-tb-group",role:"radiogroup","aria-label":I.letterCase,onKeyDown:e=>p(e,E.map(([e])=>e),e=>D.onChange(e)),children:E.map(([e,l,r])=>g(l,/* @__PURE__ */i(a,{role:"radio",pressed:D.value===e,className:S(D.value===e),"aria-checked":D.value===e,"aria-label":l,tabIndex:e===(D.value||"none")?0:-1,disabled:y||D.disabled,onMouseDown:c,onClick:()=>D.onChange(D.value===e?"":e),children:r},e)))}):null,"paragraph"===q?J:null]}),H="row"===A,P=H?" is-row":R.flow?" is-flow":R.oneRow?" is-one-row":R.words&&void 0===N&&"words"!==q?" is-eight":"",V=b(n,Boolean(k)),X={"--rosh-tb-color-col":String(V.color),"--rosh-tb-link-col":String(V.link),...H?{"--rosh-tb-cells":String(R.cells.words+R.cells.paragraph),"--rosh-tb-groupgap":R.words&&R.paragraph?"var(--space-8, 0.5rem)":"0px"}:{}};let Y;return Y=H?/* @__PURE__ */t("div",{className:"rosh-tb-row is-row",children:[R.words?/* @__PURE__ */i("div",{className:"rosh-tb-words",children:W}):null,R.paragraph?/* @__PURE__ */i("div",{className:"rosh-tb-para",children:G}):null]}):R.flow?/* @__PURE__ */t("div",{className:"rosh-tb-row is-flow",children:[W,
|
|
3
|
+
/* @__PURE__ */i("span",{className:"rosh-tb-flowgap","aria-hidden":"true"}),G]}):R.oneRow?/* @__PURE__ */t("div",{className:"rosh-tb-row is-one-row",children:[
|
|
4
|
+
/* @__PURE__ */i("div",{className:"rosh-tb-words",children:W}),
|
|
5
|
+
/* @__PURE__ */i("div",{className:"rosh-tb-para",children:G})]}):/* @__PURE__ */t(d,{children:[R.words?/* @__PURE__ */i("div",{className:"rosh-tb-row"+(void 0===N&&"words"!==q?" is-eight":""),children:W}):null,R.paragraph?/* @__PURE__ */i("div",{className:"rosh-tb-row",children:G}):null]}),/* @__PURE__ */t("div",{className:`rosh-tb-wrap${P} ${j}`.trim(),style:X,children:[
|
|
6
|
+
/* @__PURE__ */i("div",{className:"rosh-tb",role:"toolbar","aria-label":B??I.formatting,children:Y}),L]})}export{f as TextToolbar,w as textToolbarRows,b as textToolbarWindowColumns};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import{Tree as e,TreeRow as n,TreeGroup as l}from"./chunk-YJOJ5MUZ.js";import{ImageLightbox as a}from"./chunk-4LNO444F.js";import{MarqueeBox as i}from"./chunk-IC72MGON.js";import{Drawer as r}from"./chunk-GWDTGCQB.js";import{EmptyState as t}from"./chunk-JAQO3TNE.js";import{DescriptionList as o}from"./chunk-SACUSHVN.js";import{Breadcrumbs as d}from"./chunk-ZU3BD75E.js";import{ROOT_KEY as s,mediaLibraryMenu as c}from"./chunk-MQXZZBR6.js";import{useMediaMoveItems as u}from"./chunk-RPFONHXQ.js";import{MediaUploadGrid as m}from"./chunk-62RAGXWK.js";import{MediaUsedInList as h}from"./chunk-BYLGKRIT.js";import{RenameField as p}from"./chunk-WPCNJ4UL.js";import{NativeSelect as f}from"./chunk-A34PD3XT.js";import{Segmented as g}from"./chunk-S4FPYCUU.js";import{useGridSelection as v}from"./chunk-VLKDWKVR.js";import{useMarquee as k}from"./chunk-OLFYNMTD.js";import{copyToClipboard as y}from"./chunk-THSKCKAQ.js";import{Checkbox_default as b}from"./chunk-CGZBDI6C.js";import{useContextMenu as w,ContextMenu as x}from"./chunk-AIJ6OR6X.js";import{Banner as N}from"./chunk-ED5D2O6E.js";import{Input_default as C}from"./chunk-HNUKXGYP.js";import{DropdownMenu as I}from"./chunk-NZISMTQE.js";import{IconButton_default as D}from"./chunk-LE5LWALR.js";import{useFileIntake as j,FileIntakeAlert as S}from"./chunk-LBGRLG3Y.js";import{ColoredBadge as z}from"./chunk-KRH7UAD2.js";import{Button_default as O}from"./chunk-EOVXFXVV.js";import{buttonClasses as T}from"./chunk-UQYNPYF4.js";import{Icon as F}from"./chunk-2UO47XB4.js";import{Tooltip as L}from"./chunk-NJN5IKWO.js";import{usePlotWidth as A}from"./chunk-MAFUXCPZ.js";import{useShellStrings as E}from"./chunk-MBY5JIGB.js";import{useRef as P,useMemo as M,useCallback as R,useState as U,useEffect as B}from"react";import{jsxs as K,Fragment as G,jsx as J}from"react/jsx-runtime";var X="application/x-efficient-media-files",W="application/x-efficient-media-folder",Y="application/x-efficient-media-file";function H(e){if(!e||!Array.from(e.types).includes(Y))return null;try{const n=JSON.parse(e.getData(Y));if(n&&"string"==typeof n.id&&"string"==typeof n.url&&"string"==typeof n.name&&("image"===n.kind||"video"===n.kind))return{id:n.id,url:n.url,kind:n.kind,name:n.name}}catch{}return null}var Q={type:"all",use:"any",sort:"newest"},V={lock:/* @__PURE__ */J(F,{name:"lock","aria-hidden":"true",className:"h-4 w-4"}),folder:/* @__PURE__ */J(F,{name:"folder","aria-hidden":"true",className:"h-4 w-4"}),folderOpen:/* @__PURE__ */J(F,{name:"folder-open","aria-hidden":"true",className:"h-4 w-4"}),folderPlus:/* @__PURE__ */J(F,{name:"folder-plus","aria-hidden":"true",className:"h-4 w-4"}),trash:/* @__PURE__ */J(F,{name:"trash","aria-hidden":"true",className:"h-4 w-4"}),upload:/* @__PURE__ */J(F,{name:"upload","aria-hidden":"true",className:"h-4 w-4"}),search:/* @__PURE__ */J(F,{name:"search","aria-hidden":"true",className:"h-4 w-4"}),grid:/* @__PURE__ */J(F,{name:"grid","aria-hidden":"true",className:"h-4 w-4"}),list:/* @__PURE__ */J(F,{name:"list","aria-hidden":"true",className:"h-4 w-4"}),more:/* @__PURE__ */J(F,{name:"more","aria-hidden":"true",className:"h-4 w-4"}),copy:/* @__PURE__ */J(F,{name:"copy","aria-hidden":"true",className:"h-4 w-4"}),edit:/* @__PURE__ */J(F,{name:"edit","aria-hidden":"true",className:"h-4 w-4"}),swap:/* @__PURE__ */J(F,{name:"swap","aria-hidden":"true",className:"h-4 w-4"}),crop:/* @__PURE__ */J(F,{name:"crop","aria-hidden":"true",className:"h-4 w-4"}),external:/* @__PURE__ */J(F,{name:"external","aria-hidden":"true",className:"h-4 w-4"}),undo:/* @__PURE__ */J(F,{name:"undo","aria-hidden":"true",className:"h-4 w-4"})},Z={link:/* @__PURE__ */J(F,{name:"link","aria-hidden":"true",className:"h-3 w-3"}),email:/* @__PURE__ */J(F,{name:"email","aria-hidden":"true",className:"h-3 w-3"}),lock:/* @__PURE__ */J(F,{name:"lock","aria-hidden":"true",className:"h-3 w-3"}),clock:/* @__PURE__ */J(F,{name:"clock","aria-hidden":"true",className:"h-3 w-3"})};function $(F){const{mode:H="manage",layout:$="auto",location:q,onLocationChange:_,folders:ee,products:ne,allFilesCount:le,trashCount:ae,files:ie,query:re,onQueryChange:te,filters:oe=Q,onFiltersChange:de,extraFilters:se,view:ce="grid",onViewChange:ue,selectedIds:me,onSelectionChange:he,usedIn:pe,denied:fe={},accept:ge="image/*,video/*",maxSizeBytes:ve,busy:ke,progress:ye,onUpload:be,onNewFolder:we,onRename:xe,onMove:Ne,onTrash:Ce,onDeleteFolder:Ie,onRestore:De,onDeleteForever:je,onEmptyTrash:Se,onReplace:ze,onCropEdit:Oe,onOpenInDesign:Te,onChoose:Fe,onCancel:Le,pickNote:Ae,onDragOut:Ee,className:Pe=""}=F,Me=E().mediaLibrary,Re=E().media,Ue="pick"===H,Be=!Ue,Ke=P(null),Ge=A(Ke,"phone"===$?343:1200),Je="phone"===$||"auto"===$&&Ge<640,Xe=M(()=>function(e=[]){const n=/* @__PURE__ */new Map,l=(e,a)=>{for(const i of e){const e=[...a,i];n.set(i.id,{node:i,path:e}),i.children&&l(i.children,e)}};return l(e,[]),n}(ne),[ne]),We=M(()=>new Map(ee.map(e=>[e.id,e])),[ee]),Ye=M(()=>{const e=/* @__PURE__ */new Map;for(const n of ee){const l=n.parentId&&We.has(n.parentId)?n.parentId:null;e.set(l,[...e.get(l)??[],n])}return e},[ee,We]),He=R(e=>{const n=[];for(let l=e?We.get(e):void 0;l&&(n.unshift(l),!(n.length>ee.length));l=l.parentId?We.get(l.parentId):void 0);return n},[We,ee.length]),Qe=R((e,n)=>He(e).some(e=>e.id===n),[He]),[Ve,Ze]=U(()=>/* @__PURE__ */new Set(["@files"])),$e=e=>Ze(n=>{const l=new Set(n);return l.has(e)?l.delete(e):l.add(e),l}),qe=R(e=>{Ze(n=>e.every(e=>n.has(e))?n:/* @__PURE__ */new Set([...n,...e]))},[]),_e="files"===(en=q).place?`files:${en.folderId??""}`:"products"===en.place?`products:${en.nodeId??""}`:"trash";var en;B(()=>{if("files"===q.place)qe(["@files",...He(q.folderId).slice(0,-1).map(e=>e.id)]);else if("products"===q.place){const e=q.nodeId?Xe.get(q.nodeId)?.path??[]:[];qe(["@products",...e.slice(0,-1).map(e=>`p:${e.id}`)])}},[_e]);const nn="products"===q.place,ln="trash"===q.place,an="files"===q.place,rn=an?q.folderId:null,tn=nn&&q.nodeId?Xe.get(q.nodeId)?.path[0]:void 0,on=e=>e?.sharedFrom?`${Me.readOnly} ${Me.editedAtHq(e.sharedFrom)}`:Me.readOnly,dn=M(()=>ie.map(e=>e.id),[ie]),sn=M(()=>new Map(ie.map(e=>[e.id,e])),[ie]),cn=v(dn),un=M(()=>dn.filter(e=>cn.selected.has(e)),[dn,cn.selected]),mn=1===un.length?sn.get(un[0]):void 0,hn=P(!0);B(()=>{hn.current?hn.current=!1:cn.clear()},[_e]);const pn=me?.join("\0");B(()=>{me&&cn.setSelection(me)},[pn]);const fn=P(pn??""),gn=un.join("\0");B(()=>{fn.current!==gn&&(fn.current=gn,he?.(un))},[gn]);const vn=(e,n={})=>{Ue?cn.select(e):cn.select(e,{ctrl:!(!n.ctrlKey&&!n.metaKey),shift:!!n.shiftKey})},[kn,yn]=U(null),bn=e=>{const n=kn;if(yn(null),!n||null==e)return;e!==("folder"===n.kind?We.get(n.id)?.name:sn.get(n.id)?.name)&&xe?.(n,e)},wn=async e=>{if(!we)return;const n=await we(e);qe(["@files",...e?[e]:[]]),"string"==typeof n&&yn({kind:"folder",id:n})},xn=R(e=>{const n=[],l=n=>{if("files"===e.kind)return n===rn&&an?Me.alreadyHere:void 0;const l=We.get(e.id);return n===e.id||n&&Qe(n,e.id)?Me.notIntoItself:(l?.parentId??null)===n?Me.folderAlreadyHere:void 0};n.push({key:s,label:Me.allFiles,disabledReason:l(null)});const a=(e,i)=>{for(const r of Ye.get(e)??[])n.push({key:r.id,label:r.name,depth:i,disabledReason:l(r.id)}),a(r.id,i+1)};return a(null,1),n},[Ye,We,an,Qe,rn,Me]),Nn=R(e=>{const n=new Set(e.map(e=>sn.get(e)?.kind??"image"));return 1===n.size?[...n][0]:"file"},[sn]),[Cn,In]=U(null),Dn={words:Me,media:Re,denied:fe,moveTargets:xn,kindOf:Nn,urlOf:e=>sn.get(e)?.url,newSubfolder:we&&Be?e=>{wn(e)}:void 0,rename:xe&&Be?e=>{"file"!==e.kind||cn.isSelected(e.id)||cn.select(e.id),yn(e)}:void 0,move:Ne&&Be?Ne:void 0,trash:Ce&&Be?Ce:void 0,deleteFolder:Ie&&Be?Ie:void 0,folderNotEmpty:e=>!!We.get(e)?.notEmpty,replace:ze&&Be?ze:void 0,copyUrl:e=>{const n=sn.get(e)?.url;n&&y(Me.urlLabel,n)},openInDesign:Te,restore:De,deleteForever:je},jn=e=>c(e,Dn),Sn=w(),zn=(e,n)=>{Ue||(cn.isSelected(e)||cn.select(e),Sn.open(n,(e=>{const n=cn.isSelected(e)?un:[e];return nn?{kind:"render",id:e}:ln?{kind:"trashed",ids:n}:{kind:"files",ids:n}})(e)))},[On,Tn]=U(null),[Fn,Ln]=U(null),[An,En]=U(null);B(()=>{if(!Fn&&!On)return;const e=()=>{Ln(null),Tn(null)};return window.addEventListener("dragend",e),window.addEventListener("drop",e),()=>{window.removeEventListener("dragend",e),window.removeEventListener("drop",e)}},[Fn,On]);const Pn=(e,n)=>Array.from(e.dataTransfer?.types??[]).includes(n),Mn=(e,n)=>!(!Ne||fe.move||Ue)&&(!!Pn(e,X)||!(!Pn(e,W)||!An)&&(n!==An&&!(n&&Qe(n,An)))),Rn=(e,n)=>({onDragEnter:l=>{Mn(l,n)&&(l.preventDefault(),Tn(e))},onDragOver:l=>{Mn(l,n)&&(l.preventDefault(),l.dataTransfer.dropEffect="move",On!==e&&Tn(e))},onDragLeave:n=>{const l=n.relatedTarget;l&&n.currentTarget.contains(l)||Tn(n=>n===e?null:n)},onDrop:e=>{if(Mn(e,n))if(e.preventDefault(),Tn(null),Pn(e,X)){let l;try{l=JSON.parse(e.dataTransfer.getData(X))}catch{l=null}Array.isArray(l)&&l.length&&Ne({kind:"files",ids:l.map(String)},n)}else An&&(Ne({kind:"folder",id:An},n),En(null))}}),Un=e=>{const n=e=>Pn(e,X)||Pn(e,W)||Pn(e,"Files");return{onDragEnter:l=>{n(l)&&Ln(e)},onDragOver:l=>{n(l)&&Fn!==e&&Ln(e)},onDragLeave:n=>{const l=n.relatedTarget;l&&n.currentTarget.contains(l)||Ln(n=>n===e?null:n)}}},Bn=(e,n,l)=>/* @__PURE__ */J(L,{side:"right",content:Fn===e?Me.noDropProducts:on(l),open:Fn===e||!Fn&&void 0,children:/* @__PURE__ */J("span",{children:n})}),Kn=e=>({onContextMenu:n=>{Sn.open(n,e)}}),Gn=(e,a,i)=>e.map(e=>{const r=`p:${e.id}`,t=i??e,o=Ve.has(r),d=e.children?.length?e.children:null;/* @__PURE__ */
|
|
2
|
+
return K("div",{role:"none",className:"contents",children:[
|
|
3
|
+
/* @__PURE__ */J(n,{label:Bn(r,e.name,t),level:a,icon:d&&o?V.folderOpen:V.folder,count:e.count,countLabel:null!=e.count?e.countLabel??Me.fileCount(e.count):void 0,selected:nn&&q.nodeId===e.id,expanded:d?o:void 0,onToggle:d?()=>$e(r):void 0,onSelect:()=>_({place:"products",nodeId:e.id}),rowProps:{"data-media-row":r,...Un(r),...Be?Kn({kind:"product-node",id:e.id}):{}}}),d&&o&&/* @__PURE__ */J(l,{children:Gn(d,a+1,t)})]},e.id)}),Jn=(e,a)=>(Ye.get(e)??[]).map(e=>{const i=Ye.get(e.id),r=Ve.has(e.id),t="folder"===kn?.kind&&kn.id===e.id,o=jn({kind:"folder",id:e.id});/* @__PURE__ */
|
|
4
|
+
return K("div",{role:"none",className:"contents",children:[
|
|
5
|
+
/* @__PURE__ */J(n,{label:e.name,level:a,icon:i&&r?V.folderOpen:V.folder,count:e.count,countLabel:null!=e.count?e.countLabel??Me.fileCount(e.count):void 0,selected:t||an&&q.folderId===e.id,expanded:i?r:void 0,onToggle:i?()=>$e(e.id):void 0,onSelect:()=>_({place:"files",folderId:e.id}),drop:On===e.id?"into":void 0,dragging:An===e.id,draggable:Be&&!!Ne&&!fe.move,rename:t?/* @__PURE__ */J(p,{value:e.name,label:Me.folderName,onDone:bn}):void 0,actions:Be&&o.length?/* @__PURE__ */J(I,{align:"end","aria-label":Me.folderActions,trigger:V.more,items:o}):void 0,rowProps:{"data-media-row":e.id,...Rn(e.id,e.id),...Be?Kn({kind:"folder",id:e.id}):{},...Be&&Ne&&!fe.move?{draggable:!0,onDragStart:n=>{n.dataTransfer.effectAllowed="move",n.dataTransfer.setData(W,e.id),En(e.id)},onDragEnd:()=>{En(null),Tn(null)}}:{}}}),i&&r&&/* @__PURE__ */J(l,{children:Jn(e.id,a+1)})]},e.id)}),Xn=Ve.has("@files"),Wn=Ve.has("@products"),Yn=/* @__PURE__ */K(e,{"aria-label":Me.folders,children:[ne&&/* @__PURE__ */K(G,{children:[
|
|
6
|
+
/* @__PURE__ */J(n,{label:Bn("@products",Me.products),level:1,icon:V.lock,badge:{label:Me.readOnlyBadge,tone:"neutral"},expanded:ne.length?Wn:void 0,onToggle:()=>$e("@products"),selected:nn&&null==q.nodeId,onSelect:()=>_({place:"products",nodeId:null}),rowProps:{"data-media-row":"@products",...Un("@products")}}),Wn&&ne.length>0&&/* @__PURE__ */J(l,{children:Gn(ne,2)})]}),
|
|
7
|
+
/* @__PURE__ */J(n,{label:Me.allFiles,level:1,icon:Xn?V.folderOpen:V.folder,count:le,countLabel:null!=le?Me.fileCount(le):void 0,expanded:Ye.get(null)?.length?Xn:void 0,onToggle:()=>$e("@files"),selected:an&&null==q.folderId,onSelect:()=>_({place:"files",folderId:null}),drop:"@files"===On?"into":void 0,rowProps:{"data-media-row":"@files",...Rn("@files",null)}}),Xn&&(Ye.get(null)?.length??0)>0&&/* @__PURE__ */J(l,{children:Jn(null,2)}),Be&&/* @__PURE__ */J(n,{label:Me.trash,level:1,icon:V.trash,count:ae,countLabel:null!=ae?Me.fileCount(ae):void 0,selected:ln,onSelect:()=>_({place:"trash"}),rowProps:{"data-media-row":"@trash"}})]}),Hn=(()=>{if(ln)return[{label:Me.trash}];if(nn){const e=q.nodeId?Xe.get(q.nodeId)?.path??[]:[];return[{label:Me.products,onClick:e.length?()=>_({place:"products",nodeId:null}):void 0},...e.map((n,l)=>({label:n.name,onClick:l<e.length-1?()=>_({place:"products",nodeId:n.id}):void 0}))]}const e=He(rn);return[{label:Me.allFiles,onClick:e.length?()=>_({place:"files",folderId:null}):void 0},...e.map((n,l)=>({label:n.name,onClick:l<e.length-1?()=>_({place:"files",folderId:n.id}):void 0}))]})(),Qn=nn?Me.readOnly:fe.upload,Vn=!!be&&!ln&&!Qn,Zn=j({accept:ge,maxSizeBytes:ve,multiple:!0,disabled:!Vn,onAccept:e=>be?.(e,rn)}),$n=nn?Me.noProductFolder:fe.newFolder,qn=e=>e?{"aria-disabled":!0,disabledReason:e}:{},_n=/* @__PURE__ */K("div",{className:"flex flex-wrap items-center gap-2",children:[Be&&we&&!ln&&/* @__PURE__ */J(O,{variant:"secondary",size:"sm",leftIcon:V.folderPlus,onClick:()=>{wn(rn)},...qn($n),children:Me.newFolder}),be&&!ln&&/* @__PURE__ */J(O,{variant:"primary",size:"sm",leftIcon:V.upload,onClick:()=>Zn.open(),...qn(Qn),children:Me.upload}),Be&&ln&&Se&&ie.length>0&&/* @__PURE__ */J(O,{variant:"danger",size:"sm",onClick:Se,...qn(fe.deleteForever),children:Me.emptyTrash})]}),el=(e,n,l,a,i)=>/* @__PURE__ */J("div",{style:{width:Je?void 0:i,flex:Je?"1 1 120px":"0 0 auto",minWidth:0},children:/* @__PURE__ */J(f,{size:"sm","aria-label":e,value:n,onChange:a,options:l})},e),nl=e=>n=>de?.({...oe,[e]:n}),ll=/* @__PURE__ */K("div",{className:"flex flex-wrap items-center gap-2",children:[te&&/* @__PURE__ */J("div",{style:{flex:"1 1 200px",minWidth:0},children:/* @__PURE__ */J(C,{size:"sm",type:"search",leftIcon:V.search,placeholder:nn?Me.searchProducts:Me.search,"aria-label":nn?Me.searchProducts:Me.search,value:re??"",onChange:e=>te(e.target.value)})}),de&&el(Me.mediaType,oe.type,[{value:"all",label:Me.allTypes},{value:"image",label:Me.images},{value:"video",label:Me.videos},{value:"svg",label:"SVG"},{value:"gif",label:"GIF"}],nl("type"),130),de&&!nn&&!ln&&el(Me.use,oe.use,[{value:"any",label:Me.anyUse},{value:"email",label:Me.emailOnly},{value:"website",label:Me.websiteOnly},{value:"unused",label:Me.notUsed}],nl("use"),130),de&&Be&&el(Me.sort,oe.sort,[{value:"newest",label:Me.newest},{value:"name",label:Me.byName},{value:"size",label:Me.bySize}],nl("sort"),110),se?.map(e=>el(e.label,e.value,e.options,e.onChange,120)),ue&&/* @__PURE__ */J(g,{size:"sm",label:Me.view,value:ce,onChange:ue,options:[{value:"grid",label:Me.grid,icon:V.grid},{value:"list",label:Me.list,icon:V.list}]})]}),al=e=>{const n=[];return null!=e.trashedDaysAgo&&n.push({key:"t",label:Me.daysAgo(e.trashedDaysAgo),count:e.trashedDaysAgo,icon:Z.clock,tone:"neutral"}),e.usedCount&&n.push({key:"u",label:Me.used(e.usedCount),count:e.usedCount,icon:Z.link,tone:"active"}),e.email&&n.push({key:"e",label:Me.email,icon:Z.email,tone:"queued"}),e.private&&n.push({key:"p",label:Me.private,icon:Z.lock,tone:"neutral"}),n},il=e=>al(e).map(e=>/* @__PURE__ */J(z,{tone:e.tone,size:"xs",children:e.label},e.key)),rl=Be&&an&&!!Ne&&!fe.move,tl=!!Ee&&!ln,ol=e=>!tl||e.private||e.pickDisabledReason?void 0:JSON.stringify({id:e.id,url:e.url,kind:"video"===e.kind?"video":"image",name:e.name}),dl=ie.map(e=>({id:e.id,url:e.thumbUrl??e.url,name:e.name,kind:e.kind,caption:e.name,badges:al(e),dragData:rl?JSON.stringify(cn.isSelected(e.id)?un:[e.id]):ol(e),...rl&&ol(e)?{dragAlso:{[Y]:ol(e)}}:{}})),sl=Je?Math.max(72,Math.floor((Ge-24-16-1)/3)):112,cl=P(null),ul=k({containerRef:cl,enabled:Be&&!Je&&ie.length>0,selected:cn.selected,setSelection:e=>cn.setSelection(e),clearSelection:cn.clear}),ml=e=>{if(Ue){const n=sn.get(e);return void(!n||n.private||n.pickDisabledReason||Fe?.(n))}const n=dn.indexOf(e);n>=0&&In(n)},hl=ie.length?null:re?/* @__PURE__ */J(t,{variant:"dashed",title:Me.noMatches}):nn?/* @__PURE__ */J(t,{variant:"dashed",title:Me.emptyProducts,description:on(tn)}):ln?/* @__PURE__ */J(t,{variant:"dashed",title:Me.trashEmpty}):!Vn||Ue?/* @__PURE__ */J(t,{variant:"dashed",title:Me.emptyFolder}):null,pl="list"===ce&&ie.length>0,fl=hl??(pl?/* @__PURE__ */J("ul",{role:"listbox","aria-multiselectable":Be||void 0,"aria-label":Me.folders,className:"flex flex-col gap-1",children:ie.map(e=>/* @__PURE__ */K("li",{role:"option","aria-selected":cn.isSelected(e.id),tabIndex:0,"data-grid-item":"","data-grid-id":e.id,onClick:n=>vn(e.id,n),onDoubleClick:()=>ml(e.id),onContextMenu:n=>zn(e.id,n),draggable:!!ol(e)||void 0,onDragStart:ol(e)?n=>{n.dataTransfer.effectAllowed="link",n.dataTransfer.setData(Y,ol(e)),Ee("start")}:void 0,onDragEnd:ol(e)?e=>Ee("none"===e.dataTransfer.dropEffect?"cancelled":"dropped"):void 0,onKeyDown:n=>{"Enter"!==n.key&&" "!==n.key||(n.preventDefault(),vn(e.id,n))},className:"flex h-12 cursor-pointer items-center gap-3 rounded-md px-2 text-sm rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] "+(cn.isSelected(e.id)?"bg-accent-tint text-blue-700":"text-ink hover:bg-gray-100"),children:[
|
|
8
|
+
/* @__PURE__ */J("img",{src:e.thumbUrl??e.url,alt:"",className:"h-10 w-10 shrink-0 rounded bg-gray-100 object-contain"}),
|
|
9
|
+
/* @__PURE__ */J("span",{className:"min-w-0 flex-1 truncate",children:e.name}),
|
|
10
|
+
/* @__PURE__ */J("span",{className:"flex shrink-0 items-center gap-1",children:il(e)}),e.sizeLabel&&/* @__PURE__ */J("span",{className:"w-16 shrink-0 text-right text-xs text-ink-faint",children:e.sizeLabel})]},e.id))}):/* @__PURE__ */J(m,{items:dl,readOnly:!Vn||Ue,onFiles:Vn&&!Ue?e=>be(e,rn):void 0,accept:ge,maxSizeBytes:ve,busy:ke,progress:ye,fit:"contain",thumbSize:sl,dragType:rl?X:tl?Y:void 0,onDragOutChange:tl?e=>Ee(e):void 0,selected:cn.selected,onItemClick:vn,onItemDoubleClick:ml,onItemContextMenu:Be?zn:void 0,menuOnMedia:Be})),gl=u({count:un.length,kind:Nn(un),targets:xn({kind:"files",ids:un}),onPick:e=>Ne?.({kind:"files",ids:un},e.key===s?null:e.key)}),vl=T({variant:"secondary",size:"sm"}),kl=/* @__PURE__ */J(I,{align:"start",triggerClassName:vl,trigger:/* @__PURE__ */K(G,{children:[V.folder,Me.moveTo]}),items:gl,disabled:!!fe.move}),yl=Be&&un.length>1&&!nn?/* @__PURE__ */K("div",{"data-media-bulk":"",className:"flex flex-wrap items-center gap-2 rounded-lg border border-line px-3 py-2",children:[
|
|
11
|
+
/* @__PURE__ */J(b,{checked:un.length===ie.length,indeterminate:un.length<ie.length,onChange:e=>e?cn.selectAll():cn.clear(),label:Me.selected(un.length)}),/* @__PURE__ */K(G,ln?{children:[De&&/* @__PURE__ */J(O,{variant:"secondary",size:"sm",leftIcon:V.undo,onClick:()=>De(un),...qn(fe.restore),children:Me.restore}),je&&/* @__PURE__ */J(O,{variant:"secondary-danger",size:"sm",onClick:()=>je(un),...qn(fe.deleteForever),children:Me.deleteForever})]}:{children:[Ne&&kl,xe&&/* @__PURE__ */J(O,{variant:"secondary",size:"sm",leftIcon:V.edit,disabled:!0,children:Me.rename}),Ce&&/* @__PURE__ */J(O,{variant:"secondary",size:"sm",leftIcon:V.trash,onClick:()=>Ce({kind:"files",ids:un}),...qn(fe.trash),children:Me.moveFilesToTrash(un.length)})]}),
|
|
12
|
+
/* @__PURE__ */J(O,{variant:"ghost",size:"sm",onClick:cn.clear,children:Me.clearSelection})]}):null,bl=e=>{const n=[],l=(e,l,a)=>{null!=a&&""!==a&&n.push({key:e,label:l,value:a})},a="file"===kn?.kind&&kn.id===e.id;l("name",Me.name,a?/* @__PURE__ */J(p,{value:e.name,label:Me.fileName,onDone:bn}):e.name),l("type",Me.type,e.typeLabel),l("size",Me.size,e.sizeLabel),l("resolution",Me.resolution,e.resolution),nn?(l("design",Me.design,e.design),l("finish",Me.finish,e.finish),l("angle",Me.angleLug,e.angleLug),l("owner",Me.owner,e.owner)):(l("added",Me.addedBy,e.addedBy),l("folder",Me.folder,e.folderPath)),l("used",Me.usedIn,null!=e.usedCount?Me.places(e.usedCount):void 0);const i=c({kind:"files",ids:[e.id]},Dn).find(e=>"submenu"===e.type);/* @__PURE__ */
|
|
13
|
+
return K("div",{"data-media-details":"",className:"flex flex-col gap-3",children:[
|
|
14
|
+
/* @__PURE__ */J("img",{src:e.url,alt:e.name,className:"aspect-square w-full rounded-lg bg-gray-100 object-contain"}),nn&&/* @__PURE__ */J(N,{tone:"neutral",title:Me.readOnlyBadge,children:on(tn)}),
|
|
15
|
+
/* @__PURE__ */J(o,{size:"sm",columns:1,items:n}),!ln&&/* @__PURE__ */K("div",{className:"flex gap-2",children:[
|
|
16
|
+
/* @__PURE__ */J("div",{style:{flex:"1 1 0",minWidth:0},children:/* @__PURE__ */J(C,{size:"sm",readOnly:!0,value:e.url,"aria-label":Me.fileUrl,onFocus:e=>e.currentTarget.select()})}),
|
|
17
|
+
/* @__PURE__ */J(O,{variant:"secondary",size:"sm",leftIcon:V.copy,onClick:()=>Dn.copyUrl(e.id),children:Me.copyUrl})]}),an&&Be&&/* @__PURE__ */K("div",{className:"flex flex-wrap gap-2",children:[ze&&/* @__PURE__ */J(O,{variant:"secondary",size:"sm",leftIcon:V.swap,onClick:()=>ze(e.id),...qn(fe.replace),children:Me.replace}),Oe&&/* @__PURE__ */J(O,{variant:"secondary",size:"sm",leftIcon:V.crop,onClick:()=>Oe(e.id),children:Me.cropEdit}),Ne&&"submenu"===i?.type&&/* @__PURE__ */J(I,{align:"start",triggerClassName:vl,trigger:/* @__PURE__ */K(G,{children:[V.folder,Me.moveTo]}),items:i.items,disabled:!!fe.move}),xe&&/* @__PURE__ */J(O,{variant:"secondary",size:"sm",leftIcon:V.edit,onClick:()=>yn({kind:"file",id:e.id}),...qn(fe.rename),children:Me.rename}),Ce&&/* @__PURE__ */J(D,{"aria-label":Me.moveToTrash,size:"sm",onClick:()=>Ce({kind:"files",ids:[e.id]}),disabledReason:fe.trash,"aria-disabled":!!fe.trash||void 0,children:V.trash})]}),ln&&Be&&/* @__PURE__ */K("div",{className:"flex flex-wrap gap-2",children:[De&&/* @__PURE__ */J(O,{variant:"primary",size:"sm",leftIcon:V.undo,onClick:()=>De([e.id]),...qn(fe.restore),children:Me.restore}),je&&/* @__PURE__ */J(O,{variant:"danger",size:"sm",onClick:()=>je([e.id]),...qn(fe.deleteForever),children:Me.deleteForever})]}),nn&&Te&&/* @__PURE__ */J(O,{variant:"secondary",size:"sm",leftIcon:V.external,onClick:()=>Te({kind:"render",id:e.id}),children:Me.openInDesign}),pe&&/* @__PURE__ */J(h,{items:pe})]})},wl=mn?mn.private?Me.privateNoPick:mn.pickDisabledReason:void 0,xl=Ue?/* @__PURE__ */K("div",{"data-media-picker-footer":"",className:"flex flex-wrap items-center justify-between gap-2 border-t border-line px-3 py-2",children:[
|
|
18
|
+
/* @__PURE__ */J("span",{className:"min-w-0 truncate text-sm text-ink-faint",children:mn?Me.oneChosen(mn.name):Me.noneChosen}),
|
|
19
|
+
/* @__PURE__ */K("div",{className:"flex gap-2",children:[Le&&/* @__PURE__ */J(O,{variant:"secondary",size:"sm",onClick:Le,children:Me.cancel}),
|
|
20
|
+
/* @__PURE__ */J(O,{variant:"primary",size:"sm",disabled:!mn,...qn(wl),onClick:()=>{mn&&!wl&&Fe?.(mn)},children:Me.chooseImage})]})]}):null,Nl=Be&&!!mn,Cl=/* @__PURE__ */K("div",{className:"flex min-w-0 flex-col gap-3",children:[Ae&&/* @__PURE__ */J(N,{tone:"neutral",children:Ae}),
|
|
21
|
+
/* @__PURE__ */K("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[
|
|
22
|
+
/* @__PURE__ */J(d,{items:Hn}),_n]}),ll,yl,
|
|
23
|
+
/* @__PURE__ */K("div",{ref:cl,className:"relative",onPointerDown:ul.onPointerDown,onKeyDown:e=>{Be&&(e.ctrlKey||e.metaKey)&&"a"===e.key.toLowerCase()?(e.preventDefault(),cn.selectAll()):"Escape"===e.key&&cn.size&&cn.clear()},children:[fl,
|
|
24
|
+
/* @__PURE__ */J(i,{rect:ul.rect})]}),Vn&&/* @__PURE__ */J("input",{...Zn.inputProps}),
|
|
25
|
+
/* @__PURE__ */J(S,{rejections:Zn.rejections})]});/* @__PURE__ */
|
|
26
|
+
return K("div",{ref:Ke,"data-media-library":"","data-layout":Je?"phone":"wide",className:`flex h-full min-h-0 min-w-0 flex-col ${Pe}`.trim(),children:[/* @__PURE__ */K("div",Je?{className:"flex flex-col gap-3 p-3",children:[Yn,Cl]}:{className:"flex min-h-0 min-w-0 flex-1",children:[
|
|
27
|
+
/* @__PURE__ */J("div",{className:"shrink-0 overflow-y-auto border-r border-line p-3",style:{width:280,"--rosh-tree-ground":"var(--surface)"},children:Yn}),
|
|
28
|
+
/* @__PURE__ */J("div",{className:"min-w-0 flex-1 overflow-y-auto p-3",children:Cl}),Nl&&/* @__PURE__ */J("div",{className:"shrink-0 overflow-y-auto border-l border-line p-3",style:{width:300},children:bl(mn)})]}),xl,Je&&/* @__PURE__ */J(r,{open:Nl,onClose:cn.clear,side:"bottom",title:mn?.name,children:mn&&bl(mn)}),Sn.state&&/* @__PURE__ */J(x,{...Sn.props,items:jn(Sn.state.data)}),null!=Cn&&ie.length>0&&/* @__PURE__ */J(a,{images:ie.map(e=>({url:e.url,caption:e.name})),startIndex:Math.min(Cn,ie.length-1),onClose:()=>In(null)})]})}export{X as MEDIA_FILES_DRAG_TYPE,Y as MEDIA_FILE_DRAG_TYPE,W as MEDIA_FOLDER_DRAG_TYPE,$ as MediaLibrary,H as readMediaFileDrag};
|
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
import{toast_default as e}from"./chunk-
|
|
1
|
+
import{toast_default as e}from"./chunk-A3AKJDLI.js";import{useShellStrings as t}from"./chunk-MBY5JIGB.js";import{forwardRef as n,useRef as r,useState as o,useMemo as i,useEffect as a,useImperativeHandle as l}from"react";import{jsx as c,jsxs as s,Fragment as d}from"react/jsx-runtime";var u=["#ef4444","#f97316","#eab308","#22c55e","#3b82f6","#8b5cf6","#000000","#ffffff"],h=[{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),x=n(function({src:n,filename:x,onApply:m,onCancel:g},N){const L=r(null),z=r(null),D=r(null),I=r(null),P=t().annotator,$=r(P);$.current=P;const[E,S]=o("select"),[W,B]=o(u[0]),[R,j]=o(4),[H,F]=o(24),[T,A]=o(h[0].id),[U,O]=o(!0),[K,V]=o(!1),[Z,G]=o(!1),[X,Y]=o(null),[q,J]=o(null),[_,Q]=o(6),[ee,te]=o(12),[ne,re]=o([]),[oe,ie]=o(null),[ae,le]=o(null),[ce,se]=o(null),[de,ue]=o(1),[he,pe]=o(null),[xe,ye]=o(null),[me,ge]=o(null),fe=r(null),[we,be]=o(!1),ve=i(()=>ce?{w:ce.w*de,h:ce.h*de}:null,[ce,de]),ke=ve&&ae?ve.w/ae.w:1,Me=i(()=>ne.find(e=>e.id===oe)??null,[ne,oe]);a(()=>{"select"===E&&Me&&("color"in Me&&B(Me.color),"stroke"in Me&&j(Me.stroke),"rect"===Me.type&&te(Me.radius),"text"===Me.type&&(F(Me.size),A(Me.font),O(Me.bold),V(Me.italic),G(Me.underline),Y(Me.borderColor),J(Me.background),Q(Me.padding)))},[oe]),a(()=>{const t=new Image;t.crossOrigin="anonymous",t.onload=()=>{I.current=t,le({w:t.naturalWidth,h:t.naturalHeight}),re([]),ie(null)},t.onerror=()=>e.error($.current.loadFailed),t.src=n},[n]),a(()=>{if(!ae)return;const e=()=>{const e=L.current;if(!e)return;const t=e.getBoundingClientRect(),n=Math.max(0,t.width-32),r=Math.max(0,t.height-32);if(0===n||0===r)return;const o=ae.w/ae.h;let i=ae.w,a=ae.h;i>n&&(i=n,a=i/o),a>r&&(a=r,i=a*o),se({w:i,h:a})};e();const t=new ResizeObserver(e);return L.current&&t.observe(L.current),()=>t.disconnect()},[ae]);const Ne=i(()=>ne.filter(e=>"mosaic"===e.type),[ne]);a(()=>{const e=I.current,t=z.current;if(!e||!t||!ae)return;t.width=ae.w,t.height=ae.h;const n=t.getContext("2d");n.drawImage(e,0,0);for(const e of Ne)C(n,e)},[ae,Ne,ce]);const Ce=e=>{const t=D.current;if(!t)return{x:0,y:0};const n=t.createSVGPoint();n.x=e.clientX,n.y=e.clientY;const r=t.getScreenCTM();if(!r)return{x:0,y:0};const o=n.matrixTransform(r.inverse());return{x:o.x,y:o.y}},Le=e=>{fe.current=e,be(!0)};a(()=>{if(!we)return;const e=e=>{const t=fe.current;if(!t)return;const n=Ce(e);if("draw"===t.kind)pe(b(E,t.start,n,W,R,ee));else if("pen"===t.kind){const e=t.points[t.points.length-1];(Math.abs(n.x-e.x)>1||Math.abs(n.y-e.y)>1)&&(t.points.push(n),pe({id:"",type:"draw",points:t.points.slice(),color:W,stroke:R}))}else if("crop"===t.kind)ge(M(t.start,n));else if("move"===t.kind){const e=n.x-t.start.x,r=n.y-t.start.y;re(n=>n.map(n=>n.id===t.id?v(t.original,e,r):n))}else"resize"===t.kind&&re(e=>e.map(e=>e.id===t.id?function(e,t,n){if("arrow"===e.type)return"start"===t?{...e,x1:n.x,y1:n.y}:"end"===t?{...e,x2:n.x,y2:n.y}:e;if("text"===e.type||"draw"===e.type)return e;const r=e.x,o=e.x+e.w,i=e.y,a=e.y+e.h;let l=r,c=i,s=o,d=a;"nw"===t&&(l=n.x,c=n.y);"ne"===t&&(s=n.x,c=n.y);"se"===t&&(s=n.x,d=n.y);"sw"===t&&(l=n.x,d=n.y);const u=M({x:l,y:c},{x:s,y:d});return{...e,x:u.x,y:u.y,w:u.w,h:u.h}}(t.original,t.corner,n):e))},t=()=>{const e=fe.current;if(fe.current=null,be(!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 n={...e,id:p()};return re(e=>[...e,n]),ie(n.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};re(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)}},[we,E,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(),re(e=>e.filter(e=>e.id!==oe)),ie(null)):"Escape"===e.key&&ie(null))):(e.preventDefault(),re(e=>e.slice(0,-1)),void ie(null))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[oe]);const ze=e=>{const t=!{bold:U,italic:K,underline:Z}[e];"bold"===e&&O(t),"italic"===e&&V(t),"underline"===e&&G(t),oe&&re(n=>n.map(n=>n.id===oe&&"text"===n.type?{...n,[e]:t}:n))},De=e=>{Y(e),oe&&re(t=>t.map(t=>t.id===oe&&"text"===t.type?{...t,borderColor:e}:t))},Ie=e=>{J(e),oe&&re(t=>t.map(t=>t.id===oe&&"text"===t.type?{...t,background:e}:t))},Pe=e=>{if(!xe)return;const t=e??xe.value;if(!t.trim())return xe.editingId&&re(e=>e.filter(e=>e.id!==xe.editingId)),void ye(null);if(xe.editingId)re(e=>e.map(e=>e.id===xe.editingId&&"text"===e.type?{...e,text:t}:e));else{const e={id:p(),type:"text",x:xe.x,y:xe.y,text:t,color:W,size:H,font:T,bold:U,italic:K,underline:Z,borderColor:X,background:q,padding:_};re(t=>[...t,e]),ie(e.id),S("select")}ye(null)},$e=async()=>{const e=z.current,t=D.current;if(!e||!t||!ae)return null;const n=document.createElement("canvas");n.width=ae.w,n.height=ae.h;const r=n.getContext("2d");r.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),c=new Image;return await new Promise(e=>{c.onload=()=>e(),c.onerror=()=>e(),c.src=l}),r.drawImage(c,0,0,ae.w,ae.h),URL.revokeObjectURL(l),n};l(N,()=>({save:async()=>{const t=await $e();t&&t.toBlob(t=>{if(!t)return void e.error($.current.exportFailed);const n=URL.createObjectURL(t),r=document.createElement("a");r.href=n;const o=x.replace(/\.[^.]+$/,"");r.download=`${o}-annotated.png`,r.click(),URL.revokeObjectURL(n)},"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,x]);const Ee=i(()=>[{id:"select",label:P.toolSelect,icon:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 3l7 17 2-7 7-2L5 3z"})})},{id:"draw",label:P.toolDraw,icon:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("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__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("rect",{x:"4",y:"6",width:"16",height:"12",rx:"3"})})},{id:"circle",label:P.toolEllipse,icon:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("ellipse",{cx:"12",cy:"12",rx:"8",ry:"6"})})},{id:"arrow",label:P.toolArrow,icon:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 19L19 5m0 0h-7m7 0v7"})})},{id:"mosaic",label:P.toolMosaic,icon:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 4h6v6H4zM14 4h6v6h-6zM4 14h6v6H4zM14 14h6v6h-6z"})})},{id:"text",label:P.toolText,icon:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M12 6v14M9 20h6"})})},{id:"crop",label:P.toolCrop,icon:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("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"===E?null:E),Be="rect"===We||"circle"===We||"arrow"===We||"draw"===We,Re="rect"===We,je="text"===We;/* @__PURE__ */
|
|
2
2
|
return s("div",{className:"flex flex-col h-full bg-gray-100",children:[
|
|
3
|
-
/* @__PURE__ */s("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-line bg-surface shrink-0 flex-wrap text-xs",children:[
|
|
3
|
+
/* @__PURE__ */s("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-line bg-surface shrink-0 flex-wrap text-xs",children:[Ee.map(e=>/* @__PURE__ */c("button",{onClick:()=>{S(e.id),ie(null)},title:e.label,className:Se(E===e.id),children:e.icon},e.id)),
|
|
4
4
|
/* @__PURE__ */c("div",{className:"h-5 w-px bg-gray-300 mx-1"}),
|
|
5
5
|
/* @__PURE__ */c("div",{className:"flex items-center gap-1",children:u.map(e=>/* @__PURE__ */c("button",{onClick:()=>(e=>{B(e),oe&&re(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__ */s(d,{children:[
|
|
6
6
|
/* @__PURE__ */c("div",{className:"h-5 w-px bg-gray-300 mx-1"}),
|
|
7
7
|
/* @__PURE__ */s("label",{className:"flex items-center gap-2 text-gray-600",children:[
|
|
8
|
-
/* @__PURE__ */c("span",{children:
|
|
8
|
+
/* @__PURE__ */c("span",{children:P.weight}),
|
|
9
9
|
/* @__PURE__ */c("input",{type:"range",min:1,max:20,step:1,value:R,onChange:e=>{return t=Number(e.target.value),j(t),void(oe&&re(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__ */c("span",{className:"tabular-nums w-5 text-right",children:R})]})]}),Re&&/* @__PURE__ */s(d,{children:[
|
|
11
11
|
/* @__PURE__ */c("div",{className:"h-5 w-px bg-gray-300 mx-1"}),
|
|
12
12
|
/* @__PURE__ */s("label",{className:"flex items-center gap-2 text-gray-600",children:[
|
|
13
|
-
/* @__PURE__ */c("span",{children:
|
|
13
|
+
/* @__PURE__ */c("span",{children:P.radius}),
|
|
14
14
|
/* @__PURE__ */c("input",{type:"range",min:0,max:48,step:1,value:ee,onChange:e=>{return t=Number(e.target.value),te(t),void(oe&&re(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__ */c("span",{className:"tabular-nums w-6 text-right",children:ee})]})]}),je&&/* @__PURE__ */s(d,{children:[
|
|
16
16
|
/* @__PURE__ */c("div",{className:"h-5 w-px bg-gray-300 mx-1"}),
|
|
17
|
-
/* @__PURE__ */c("select",{value:T,onChange:e=>{return t=e.target.value,
|
|
18
|
-
/* @__PURE__ */c("button",{onClick:()=>ze("bold"),className:Se(
|
|
19
|
-
/* @__PURE__ */c("button",{onClick:()=>ze("italic"),className:Se(
|
|
20
|
-
/* @__PURE__ */c("button",{onClick:()=>ze("underline"),className:Se(Z),title:
|
|
17
|
+
/* @__PURE__ */c("select",{value:T,onChange:e=>{return t=e.target.value,A(t),void(oe&&re(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:h.map(e=>/* @__PURE__ */c("option",{value:e.id,children:P[e.name]},e.id))}),
|
|
18
|
+
/* @__PURE__ */c("button",{onClick:()=>ze("bold"),className:Se(U),title:P.bold,children:/* @__PURE__ */c("span",{className:"font-bold",children:P.boldLetter})}),
|
|
19
|
+
/* @__PURE__ */c("button",{onClick:()=>ze("italic"),className:Se(K),title:P.italic,children:/* @__PURE__ */c("span",{className:"italic",children:P.italicLetter})}),
|
|
20
|
+
/* @__PURE__ */c("button",{onClick:()=>ze("underline"),className:Se(Z),title:P.underline,children:/* @__PURE__ */c("span",{className:"underline",children:P.underlineLetter})}),
|
|
21
21
|
/* @__PURE__ */s("label",{className:"flex items-center gap-2 text-gray-600",children:[
|
|
22
|
-
/* @__PURE__ */c("span",{children:
|
|
23
|
-
/* @__PURE__ */c("input",{type:"range",min:10,max:96,step:1,value:
|
|
24
|
-
/* @__PURE__ */c("span",{className:"tabular-nums w-7 text-right",children:
|
|
22
|
+
/* @__PURE__ */c("span",{children:P.size}),
|
|
23
|
+
/* @__PURE__ */c("input",{type:"range",min:10,max:96,step:1,value:H,onChange:e=>{return t=Number(e.target.value),F(t),void(oe&&re(e=>e.map(e=>e.id===oe&&"text"===e.type?{...e,size:t}:e)));var t},className:"w-16 accent-blue-500"}),
|
|
24
|
+
/* @__PURE__ */c("span",{className:"tabular-nums w-7 text-right",children:H})]}),
|
|
25
25
|
/* @__PURE__ */s("label",{className:"flex items-center gap-1 text-gray-600",children:[
|
|
26
|
-
/* @__PURE__ */c("span",{children:
|
|
27
|
-
/* @__PURE__ */c("input",{type:"color",value:X,onChange:e=>De(e.target.value),title:
|
|
28
|
-
/* @__PURE__ */c("button",{onClick:()=>De(null),title:
|
|
26
|
+
/* @__PURE__ */c("span",{children:P.border}),X?/* @__PURE__ */s(d,{children:[
|
|
27
|
+
/* @__PURE__ */c("input",{type:"color",value:X,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__ */c("button",{onClick:()=>De(null),title:P.removeBorder,className:"px-0.5 text-gray-400 hover:text-gray-700",children:"✕"})]}):/* @__PURE__ */c("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__ */s("label",{className:"flex items-center gap-1 text-gray-600",children:[
|
|
30
|
-
/* @__PURE__ */c("span",{children:
|
|
31
|
-
/* @__PURE__ */c("input",{type:"color",value:q,onChange:e=>
|
|
32
|
-
/* @__PURE__ */c("button",{onClick:()=>
|
|
30
|
+
/* @__PURE__ */c("span",{children:P.fill}),q?/* @__PURE__ */s(d,{children:[
|
|
31
|
+
/* @__PURE__ */c("input",{type:"color",value:q,onChange:e=>Ie(e.target.value),title:P.fillColor,className:"h-5 w-6 rounded border border-gray-300 bg-white p-0 cursor-pointer"}),
|
|
32
|
+
/* @__PURE__ */c("button",{onClick:()=>Ie(null),title:P.removeFill,className:"px-0.5 text-gray-400 hover:text-gray-700",children:"✕"})]}):/* @__PURE__ */c("button",{onClick:()=>Ie("#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__ */s("label",{className:"flex items-center gap-2 text-gray-600",children:[
|
|
34
|
-
/* @__PURE__ */c("span",{children:
|
|
35
|
-
/* @__PURE__ */c("input",{type:"range",min:0,max:40,step:1,value:
|
|
36
|
-
/* @__PURE__ */c("span",{className:"tabular-nums w-6 text-right",children:
|
|
34
|
+
/* @__PURE__ */c("span",{children:P.padding}),
|
|
35
|
+
/* @__PURE__ */c("input",{type:"range",min:0,max:40,step:1,value:_,onChange:e=>{return t=Number(e.target.value),Q(t),void(oe&&re(e=>e.map(e=>e.id===oe&&"text"===e.type?{...e,padding:t}:e)));var t},className:"w-14 accent-blue-500"}),
|
|
36
|
+
/* @__PURE__ */c("span",{className:"tabular-nums w-6 text-right",children:_})]})]}),
|
|
37
37
|
/* @__PURE__ */c("div",{className:"h-5 w-px bg-gray-300 mx-1"}),
|
|
38
|
-
/* @__PURE__ */c("button",{onClick:()=>ue(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__ */c("button",{onClick:()=>ue(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__ */s("span",{className:"text-gray-600 tabular-nums w-10 text-center",children:[Math.round(100*de),"%"]}),
|
|
40
|
-
/* @__PURE__ */c("button",{onClick:()=>ue(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__ */c("button",{onClick:()=>ue(1),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-700",title:
|
|
40
|
+
/* @__PURE__ */c("button",{onClick:()=>ue(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__ */c("button",{onClick:()=>ue(1),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-700",title:P.fitHint,children:P.fit}),
|
|
42
42
|
/* @__PURE__ */c("div",{className:"h-5 w-px bg-gray-300 mx-1"}),
|
|
43
|
-
/* @__PURE__ */c("button",{onClick:()=>{re(e=>e.slice(0,-1)),ie(null)},disabled:0===ne.length,className:"px-2 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-700",children:
|
|
43
|
+
/* @__PURE__ */c("button",{onClick:()=>{re(e=>e.slice(0,-1)),ie(null)},disabled:0===ne.length,className:"px-2 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-700",children:P.undo}),
|
|
44
44
|
/* @__PURE__ */s("div",{className:"ml-auto flex items-center gap-2",children:[me&&/* @__PURE__ */s(d,{children:[
|
|
45
|
-
/* @__PURE__ */c("button",{onClick:()=>{if(!me||!
|
|
46
|
-
/* @__PURE__ */c("button",{onClick:()=>ge(null),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-700",children:
|
|
47
|
-
/* @__PURE__ */c("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:
|
|
45
|
+
/* @__PURE__ */c("button",{onClick:()=>{if(!me||!I.current||!ae)return;const e=me,t=document.createElement("canvas");t.width=Math.round(e.w),t.height=Math.round(e.h);const n=t.getContext("2d"),r=document.createElement("canvas");r.width=ae.w,r.height=ae.h;const o=r.getContext("2d");o.drawImage(I.current,0,0);for(const e of Ne)C(o,e);n.drawImage(r,e.x,e.y,e.w,e.h,0,0,e.w,e.h);const i=new Image;i.onload=()=>{I.current=i,le({w:i.naturalWidth,h:i.naturalHeight}),re(t=>t.filter(e=>"mosaic"!==e.type).map(t=>v(t,-e.x,-e.y)).filter(e=>function(e,t,n){const r=k(e);return r.x+r.w>0&&r.y+r.h>0&&r.x<t&&r.y<n}(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__ */c("button",{onClick:()=>ge(null),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-700",children:P.cancel})]}),m&&!me&&/* @__PURE__ */s(d,{children:[g&&/* @__PURE__ */c("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__ */c("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__ */c("div",{ref:L,className:"flex-1 overflow-auto bg-gray-200 flex items-center justify-center p-4 relative",children:ve&&ae&&/* @__PURE__ */s("div",{className:"relative shadow-lg rounded overflow-hidden bg-white shrink-0",style:{width:ve.w,height:ve.h},children:[
|
|
49
49
|
/* @__PURE__ */c("canvas",{ref:z,style:{position:"absolute",inset:0,width:"100%",height:"100%",display:"block"}}),
|
|
50
|
-
/* @__PURE__ */s("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"===
|
|
51
|
-
/* @__PURE__ */c("div",{className:"px-3 py-2 border-t border-line bg-surface text-2xs text-ink-faint shrink-0",children:"select"===
|
|
50
|
+
/* @__PURE__ */s("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"===E?"default":"text"===E?"text":"crosshair"},onPointerDown:e=>{if("select"===E)return void ie(null);if("text"===E){if(xe)return void Pe();const t=Ce(e);return void ye({x:t.x,y:t.y,value:""})}const t=Ce(e);if("crop"!==E){if("draw"===E)return Le({kind:"pen",points:[t]}),void pe({id:"",type:"draw",points:[t],color:W,stroke:R});pe(b(E,t,t,W,R,ee)),Le({kind:"draw",start:t})}else Le({kind:"crop",start:t})},children:[ne.map(e=>/* @__PURE__ */c(y,{anno:e,selected:oe===e.id,zoom:de,onPointerDown:t=>((e,t)=>{"select"===E&&(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&&ye({x:t.x,y:t.y,value:t.text,editingId:t.id})},onHandlePointerDown:(t,n)=>((e,t,n)=>{e.stopPropagation(),Le({kind:"resize",id:t.id,corner:n,start:Ce(e),original:t})})(t,e,n)},e.id)),he&&/* @__PURE__ */c(y,{anno:{...he,id:"__preview"},preview:!0}),me&&/* @__PURE__ */c(f,{rect:me,imageSize:ae})]}),xe&&/* @__PURE__ */c(w,{pendingText:xe,color:W,size:H,font:h.find(e=>e.id===T)?.css??h[0].css,bold:U,italic:K,underline:Z,borderColor:X,background:q,padding:_,scale:ke,onChange:e=>ye({...xe,value:e}),onCommit:Pe,onCancel:()=>ye(null)})]})}),
|
|
51
|
+
/* @__PURE__ */c("div",{className:"px-3 py-2 border-t border-line bg-surface text-2xs text-ink-faint shrink-0",children:"select"===E?oe?P.hintSelected:P.hintSelect:"text"===E?P.hintText:"crop"===E?P.hintCrop:"draw"===E?P.hintDraw:P.hintShape})]})});function y({anno:e,selected:t,preview:n,zoom:r=1,onPointerDown:o,onDoubleClick:i,onHandlePointerDown:a}){const l=k(e),u=o?{onPointerDown:o,pointerEvents:"all",style:{cursor:"move"}}:{},p=i?{onDoubleClick:i}:{};let x;if("rect"===e.type)x=/* @__PURE__ */c("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",...u});else if("circle"===e.type)x=/* @__PURE__ */c("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,...u});else if("arrow"===e.type)x=/* @__PURE__ */c(g,{anno:e,interactive:u});else if("draw"===e.type)x=/* @__PURE__ */c("path",{d:N(e.points),fill:"none",stroke:e.color,strokeWidth:e.stroke,strokeLinecap:"round",strokeLinejoin:"round",...u});else if("mosaic"===e.type)x=/* @__PURE__ */c("rect",{x:e.x,y:e.y,width:e.w,height:e.h,fill:"rgba(0,0,0,0.001)",stroke:t?"#3b82f6":"none",strokeWidth:t?2:0,strokeDasharray:t?"6,4":void 0,...u});else{const t=h.find(t=>t.id===e.font)?.css??h[0].css,n=e.padding??0,r=!!e.borderColor||!!e.background,o=k(e),i=e.borderColor?Math.max(1,Math.round(e.size/12)):0;x=/* @__PURE__ */s("g",{...u,...p,children:[r&&/* @__PURE__ */c("rect",{x:o.x-n,y:o.y-n,width:Math.max(0,o.w)+2*n,height:Math.max(0,o.h)+2*n,rx:Math.min(8,n),ry:Math.min(8,n),fill:e.background??"none",stroke:e.borderColor??"none",strokeWidth:i}),
|
|
52
52
|
/* @__PURE__ */c("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,n)=>/* @__PURE__ */c("tspan",{x:e.x,dy:0===n?0:1.2*e.size,children:t},n))})]})}/* @__PURE__ */
|
|
53
53
|
return s("g",{children:[x,t&&!n&&/* @__PURE__ */s(d,{children:[
|
|
54
54
|
/* @__PURE__ */c("rect",{"data-chrome":"selection",x:l.x-4,y:l.y-4,width:l.w+8,height:l.h+8,fill:"none",stroke:"#3b82f6",strokeWidth:2/r,strokeDasharray:`${6/r},${4/r}`,pointerEvents:"none"}),a&&/* @__PURE__ */c(m,{anno:e,zoom:r,onHandlePointerDown:a})]})]})}function m({anno:e,zoom:t,onHandlePointerDown:n}){const r=6/t,o=1.5/t,i=e=>({fill:"#fff",stroke:"#3b82f6",strokeWidth:o,pointerEvents:"all",style:{cursor:e},"data-chrome":"handle"});if("arrow"===e.type)/* @__PURE__ */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{DropdownMenu as e}from"./chunk-
|
|
1
|
+
import{DropdownMenu as e}from"./chunk-NZISMTQE.js";import{Fragment as t}from"react";import{jsxs as a,jsx as r,Fragment as n}from"react/jsx-runtime";var i="relative inline-flex items-center gap-2 px-4 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-40",s="bg-blue-50 text-blue-600",l="text-gray-600 hover:bg-gray-50 hover:text-gray-900";function c(){/* @__PURE__ */
|
|
2
2
|
return r("span",{className:"my-3 w-px shrink-0 bg-gray-200","aria-hidden":!0})}function m({item:e,active:t,caret:i}){/* @__PURE__ */
|
|
3
3
|
return a(n,{children:[e.icon&&/* @__PURE__ */r("span",{className:"h-4 w-4 shrink-0",children:e.icon}),
|
|
4
4
|
/* @__PURE__ */r("span",{className:"whitespace-nowrap",children:e.label}),null!=e.badge&&/* @__PURE__ */r("span",{className:"ml-0.5 inline-flex min-w-[1.25rem] items-center justify-center rounded-full bg-gray-100 px-2 text-2xs font-semibold leading-5 text-gray-600",children:e.badge}),i&&/* @__PURE__ */r("span",{className:"-ml-1 text-xs","aria-hidden":!0,children:"▾"}),t&&/* @__PURE__ */r("span",{className:"absolute inset-x-2 -bottom-px h-0.5 rounded-full bg-blue-600","aria-hidden":!0})]})}function d({items:n,activeKey:d,onSelect:o,brand:u,actions:b,linkAs:h,className:g}){/* @__PURE__ */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{useShellStrings as t}from"./chunk-
|
|
1
|
+
import{useShellStrings as t}from"./chunk-MBY5JIGB.js";import{jsxs as e,jsx as r}from"react/jsx-runtime";var o={403:t=>({title:t.forbidden,body:t.forbiddenBody}),404:t=>({title:t.notFound,body:t.notFoundBody}),500:t=>({title:t.serverError,body:t.serverErrorBody})};function i({code:i=404,actions:n}){const d=o[i](t().errors);/* @__PURE__ */
|
|
2
2
|
return e("div",{className:"flex h-full flex-col items-center justify-center bg-gray-50 p-6 text-center",children:[
|
|
3
3
|
/* @__PURE__ */r("div",{className:"text-7xl font-bold tracking-tight text-gray-400",children:i}),
|
|
4
4
|
/* @__PURE__ */r("h1",{className:"mt-2 text-xl font-semibold text-gray-900",children:d.title}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{toast_default as t}from"./chunk-
|
|
1
|
+
import{toast_default as t}from"./chunk-A3AKJDLI.js";import{currentShellStrings as e}from"./chunk-MBY5JIGB.js";function n(t){let e=null;try{e=window.getSelection()}catch{return null}if(!e||0===e.rangeCount||e.isCollapsed)return null;const n=t;if(n&&"number"==typeof n.nodeType){let t=!1;for(let r=0;r<e.rangeCount&&!t;r++)t=e.getRangeAt(r).intersectsNode(n);if(!t)return null}const r=e.toString();if(!r.trim())return null;const o=document.createElement("div");for(let t=0;t<e.rangeCount;t++)o.appendChild(e.getRangeAt(t).cloneContents());return{text:r,html:o.innerHTML}}async function r(t,e){try{if(e&&"undefined"!=typeof ClipboardItem&&navigator.clipboard?.write)return await navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([t],{type:"text/plain"}),"text/html":new Blob([e],{type:"text/html"})})]),!0;if(navigator.clipboard?.writeText)return await navigator.clipboard.writeText(t),!0}catch{}const n=n=>{n.clipboardData?.setData("text/plain",t),e&&n.clipboardData?.setData("text/html",e),n.preventDefault()},r=document.createElement("textarea");r.value=t,r.style.position="fixed",r.style.opacity="0",document.body.appendChild(r),r.select(),document.addEventListener("copy",n);try{return document.execCommand("copy")}catch{return!1}finally{document.removeEventListener("copy",n),r.remove()}}async function o(n,o,a){const i=await r(o,a),l=e().copy;return i?t.success(l.copiedLabel(n)):t.error(l.failed),i}export{o as copyToClipboard,n as selectionAt,r as writeClipboard};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{ChartTooltip as e}from"./chunk-36VIGB6J.js";import{axisGutter as t,radiusScale as i,niceMax as l,logScale as r,linearScale as o}from"./chunk-2JWPNR2U.js";import{usePlotWidth as n}from"./chunk-MAFUXCPZ.js";import{CHART_INK as a,resolveSeriesColorWithin as s}from"./chunk-TZFACUMR.js";import{registerModalEscapeInterceptor as c}from"./chunk-TWVUQUUD.js";import{useShellStrings as m,useShellLocale as h}from"./chunk-
|
|
2
|
-
return y("div",{className:
|
|
3
|
-
return g("div",{className:`relative ${
|
|
4
|
-
/* @__PURE__ */g("svg",{width:"100%",height:k,viewBox:`0 0 ${
|
|
5
|
-
/* @__PURE__ */y("defs",{children:/* @__PURE__ */y("clipPath",{id:
|
|
1
|
+
import{ChartTooltip as e}from"./chunk-36VIGB6J.js";import{axisGutter as t,radiusScale as i,niceMax as l,logScale as r,linearScale as o}from"./chunk-2JWPNR2U.js";import{usePlotWidth as n}from"./chunk-MAFUXCPZ.js";import{CHART_INK as a,resolveSeriesColorWithin as s}from"./chunk-TZFACUMR.js";import{registerModalEscapeInterceptor as c}from"./chunk-TWVUQUUD.js";import{useShellStrings as m,useShellLocale as h}from"./chunk-MBY5JIGB.js";import{formatPlain as f}from"./chunk-C3QOHMR6.js";import{useRef as u,useId as p,useState as d,useEffect as x}from"react";import{jsx as y,jsxs as g}from"react/jsx-runtime";var b=3;function k({series:b,height:k=260,width:v,xLabel:M,yLabel:A,formatX:z,formatY:$,xDomain:j,yDomain:w,xScale:N="linear",yScale:R="linear",radiusRange:S=[4,22],className:U,emptyLabel:B}){const D=m().charts,L=h(),I=z??(e=>f(e,L)),P=$??(e=>f(e,L)),V=B??D.noObservations,W=u(null),C=n(W),E=v??C,J=p(),[O,F]=d(null);x(()=>{if(null!==O)return c(e=>"Escape"===e.key&&(F(null),!0))},[O]);const G=(e,t)=>!t||e>=Math.min(t[0],t[1])&&e<=Math.max(t[0],t[1]),Q=b.map((e,t)=>({...e,slot:t})).filter(e=>e.points.length>0),T=j||w?Q.map(e=>({...e,points:e.points.filter(e=>G(e.x,j)&&G(e.y,w))})).filter(e=>e.points.length>0):Q,X=Q.reduce((e,t)=>e+t.points.length,0)-T.reduce((e,t)=>e+t.points.length,0);if(0===T.length)/* @__PURE__ */
|
|
2
|
+
return y("div",{className:U,ref:W,children:/* @__PURE__ */y("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:k},children:V})});const Y=T.flatMap(e=>e.points),Z=Y.some(e=>null!=e.size),H=14,K=20,q=34,_=52,ee=(e,t,i,n)=>{const a=e.filter(e=>e>0),s="log"===i?a.length>0?Math.min(...a):0:Math.min(0,...e),c=t??[s,l(Math.max(...e))];return"log"===i?r(c,n):o(c,n)},te=ee(Y.map(e=>e.y),w,R,{from:k-q,to:H}),ie=t(te.ticks(5).map(P),_),le=Math.max(ie+1,E-K),re=ee(Y.map(e=>e.x),j,N,{from:ie,to:le}),oe=i([0,Math.max(...Y.map(e=>e.size??1))],{from:S[0],to:S[1]}),ne=O?T[O.s]:void 0,ae=O&&ne?ne.points[O.i]:void 0,se=T.flatMap((e,t)=>e.points.map((e,i)=>({s:t,i:i})));/* @__PURE__ */
|
|
3
|
+
return g("div",{className:`relative ${U??""}`,ref:W,children:[
|
|
4
|
+
/* @__PURE__ */g("svg",{width:"100%",height:k,viewBox:`0 0 ${E} ${k}`,role:"img","aria-label":D.scatter(T.map(e=>e.label),A??D.yAxis,M??D.xAxis)+(X>0?`. ${D.outsideRange(X)}`:""),tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>F(null),onBlur:()=>F(null),onKeyDown:e=>{if("ArrowRight"!==e.key&&"ArrowLeft"!==e.key)return;e.preventDefault();const t="ArrowRight"===e.key?1:-1,i=O?se.findIndex(e=>e.s===O.s&&e.i===O.i):0;F(se[Math.min(se.length-1,Math.max(0,i+t))])},children:[
|
|
5
|
+
/* @__PURE__ */y("defs",{children:/* @__PURE__ */y("clipPath",{id:J,children:/* @__PURE__ */y("rect",{x:ie-S[1],y:H-S[1],width:le-ie+2*S[1],height:k-q-H+2*S[1]})})}),te.ticks(5).map(e=>/* @__PURE__ */g("g",{children:[
|
|
6
6
|
/* @__PURE__ */y("line",{x1:ie,y1:te(e),x2:le,y2:te(e),stroke:a.grid,strokeWidth:1,shapeRendering:"crispEdges"}),
|
|
7
|
-
/* @__PURE__ */y("text",{x:ie-8,y:te(e)+4,textAnchor:"end",fontSize:11,fill:a.label,style:{fontVariantNumeric:"tabular-nums"},children:
|
|
8
|
-
/* @__PURE__ */y("g",{clipPath:`url(#${
|
|
7
|
+
/* @__PURE__ */y("text",{x:ie-8,y:te(e)+4,textAnchor:"end",fontSize:11,fill:a.label,style:{fontVariantNumeric:"tabular-nums"},children:P(e)})]},`y${e}`)),re.ticks(5).map(e=>/* @__PURE__ */y("text",{x:re(e),y:k-12,textAnchor:"middle",fontSize:11,fill:a.label,style:{fontVariantNumeric:"tabular-nums"},children:I(e)},`x${e}`)),M&&/* @__PURE__ */y("text",{x:(ie+le)/2,y:k-.5,textAnchor:"middle",fontSize:11,fill:a.label,children:M}),A&&/* @__PURE__ */y("text",{x:12,y:k/2,transform:`rotate(-90 12 ${k/2})`,textAnchor:"middle",fontSize:11,fill:a.label,children:A}),
|
|
8
|
+
/* @__PURE__ */y("g",{clipPath:`url(#${J})`,children:T.map((e,t)=>{const i=s(e.slot,3,e.color,e.tone);return e.points.map((l,r)=>/* @__PURE__ */y("circle",{cx:re(l.x),cy:te(l.y),r:Z?oe(l.size??0):S[0]+1,fill:i,fillOpacity:O&&O.s!==t?.25:.62,stroke:a.surface,strokeWidth:2,onMouseEnter:()=>F({s:t,i:r})},`${e.key}-${r}`))})})]}),O&&ne&&ae&&/* @__PURE__ */y("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */y(e,{title:ae.label??ne.label,rows:[{key:"x",label:M??D.xAxis,color:s(ne.slot,3,ne.color,ne.tone),value:I(ae.x)},{key:"y",label:A??D.yAxis,color:s(ne.slot,3,ne.color,ne.tone),value:P(ae.y)},...null!=ae.size?[{key:"size",label:D.size,color:a.muted,value:f(ae.size,L)}]:[]],footnote:ae.label?ne.label:void 0})})]})}export{b as SCATTER_SERIES_CAP,k as ScatterChart};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Tooltip as n}from"./chunk-NJN5IKWO.js";import{useShellStrings as r,useShellLocale as e}from"./chunk-
|
|
1
|
+
import{Tooltip as n}from"./chunk-NJN5IKWO.js";import{useShellStrings as r,useShellLocale as e}from"./chunk-MBY5JIGB.js";import{formatPlain as t}from"./chunk-C3QOHMR6.js";import{jsx as i,jsxs as o}from"react/jsx-runtime";var a=["inline-flex h-5 min-w-5 shrink-0 items-center justify-center rounded-md px-1","text-2xs font-medium normal-case leading-none tabular-nums tracking-normal","ring-1 ring-inset ring-[color:color-mix(in_srgb,currentColor_20%,transparent)]"].join(" ");function s({count:s,label:c,active:l=!1,showZero:m=!1,className:u=""}){const d=r().count,h=e();if(!(s>0||0===s&&m))return null;const f=c??d.items(s);/* @__PURE__ */
|
|
2
2
|
return i(n,{content:f,describe:!1,className:`relative inline-flex shrink-0 ${u}`.trim(),children:/* @__PURE__ */o("span",{"data-item-count":"",className:`${a} ${l?"bg-blue-100 text-blue-700":"bg-[color:color-mix(in_srgb,var(--ink-faint)_14%,transparent)] text-gray-600"}`,children:[
|
|
3
3
|
/* @__PURE__ */i("span",{"aria-hidden":"true",children:t(s,h)}),
|
|
4
4
|
/* @__PURE__ */i("span",{className:"sr-only",children:f})]})})}export{s as ItemCount};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{useShellLocale as e}from"./chunk-
|
|
1
|
+
import{useShellLocale as e}from"./chunk-MBY5JIGB.js";import{formatPlain as t}from"./chunk-C3QOHMR6.js";import{useState as r,useEffect as n,Children as i}from"react";import{jsxs as l,jsx as a}from"react/jsx-runtime";var s={xs:24,sm:32,md:40,lg:56},o={online:"bg-green-500",offline:"bg-gray-400",busy:"bg-red-500",away:"bg-amber-500"};function m(e){if(!e)return"?";const t=e.trim().split(/\s+/).filter(Boolean);if(0===t.length)return"?";return((t[0][0]??"")+(t.length>1?t[t.length-1][0]:"")).toUpperCase()||"?"}function c({src:e,name:t,size:i="md",status:c,className:u=""}){const h=s[i],f=Math.max(8,Math.round(.28*h)),[d,g]=r(!1);n(()=>{g(!1)},[e]);const y=Boolean(e)&&!d;
|
|
2
2
|
/* @__PURE__ */
|
|
3
3
|
return l("span",{className:`relative inline-flex shrink-0 ${u}`.trim(),style:{width:h,height:h},...t?{role:"img","aria-label":t}:{"aria-hidden":!0},children:[y?/* @__PURE__ */a("img",{src:e,alt:"",onError:()=>g(!0),className:"h-full w-full rounded-full object-cover"}):/* @__PURE__ */a("span",{className:"flex h-full w-full items-center justify-center rounded-full bg-gray-100 font-medium text-gray-600",style:{fontSize:Math.round(.4*h)},children:m(t)}),c&&/* @__PURE__ */a("span",{className:`absolute bottom-0 right-0 rounded-full ring-2 ring-white ${o[c]}`,style:{width:f,height:f}})]})}function u({children:r,max:n,size:o="md",className:m=""}){const c=i.toArray(r),u=n?c.slice(0,n):c,h=n?c.length-u.length:0,f=s[o],d=Math.round(.3*f),g=e();/* @__PURE__ */
|
|
4
4
|
return l("div",{className:`flex items-center ${m}`.trim(),children:[u.map((e,t)=>/* @__PURE__ */a("span",{className:"rounded-full ring-2 ring-white",style:{marginLeft:0===t?0:-d},children:e},t)),h>0&&/* @__PURE__ */l("span",{className:"flex items-center justify-center rounded-full bg-gray-200 font-medium text-gray-600 ring-2 ring-white",style:{width:f,height:f,marginLeft:-d,fontSize:Math.round(.36*f)},children:["+",t(h,g)]})]})}export{c as Avatar,u as AvatarGroup};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{client_default as a}from"./chunk-
|
|
1
|
+
import{client_default as a}from"./chunk-AICGATHE.js";var t=()=>a.get("/auth/numbering-configs/").then(a=>a.data?.results??a.data??[]),e="uploaded:wallpaper";function r(a,t){return"string"!=typeof a||!a||"none"===a||a.startsWith("#")?"":a===e?t||"":a}var l=()=>a.get("/auth/me/wallpaper/").then(a=>a.data),n=(t,e)=>{const r=new FormData;r.append("wallpaper",t);const l=e?{onUploadProgress:a=>e(a.total?Math.round(a.loaded/a.total*100):null)}:void 0;return a.post("/auth/me/wallpaper/",r,l).then(a=>a.data)},p=()=>a.delete("/auth/me/wallpaper/").then(a=>a.data);function o(a){const t=a?.response?.status,e=a?.response?.data,r=Array.isArray(e?.wallpaper)?e.wallpaper[0]:void 0;return r||(413===t?"That picture is too large to use as a wallpaper.":415===t?"That file is not a picture this can use as a wallpaper.":"The wallpaper could not be saved. Please try again.")}export{e as WALLPAPER_PREF_TOKEN,p as deleteWallpaper,t as getNumberingConfigs,l as getWallpaper,n as uploadWallpaper,r as wallpaperSrc,o as wallpaperUploadError};
|