efficient-shell 12.0.0 → 12.1.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 +43 -0
- package/dist/{Browser-CXZAXF55.js → Browser-U3SO6PSV.js} +17 -17
- package/dist/Calculator-6XGTP5OQ.js +29 -0
- package/dist/{CurrencyConverter-WFC3TAL4.js → CurrencyConverter-XNWE5MQW.js} +11 -11
- package/dist/Files-S4AFZX4N.js +121 -0
- package/dist/{Notepad-B7CKQ54M.js → Notepad-YYNH67EN.js} +10 -10
- package/dist/PdfViewer-ZI3QOG4G.js +1 -0
- package/dist/{PomodoroTimer-JMJORKWZ.js → PomodoroTimer-SBV43YX6.js} +68 -68
- package/dist/{Preview-OELV5X55.js → Preview-KV3L22LT.js} +27 -27
- package/dist/Sidebar-XVVZJ7PR.js +44 -0
- package/dist/{Stock-R3436P6X.js → Stock-GODZPUR3.js} +3 -3
- package/dist/{Weather-6N3ZPO2Q.js → Weather-2IIV4CFT.js} +20 -20
- package/dist/{WorldClock-BJKYHGLS.js → WorldClock-JW4MLMCB.js} +7 -7
- package/dist/ai/index.js +57 -57
- package/dist/apps/index.d.ts +125 -1
- package/dist/apps/index.js +1 -1
- package/dist/bin/media-host-check.js +1 -1
- package/dist/bin/ui-check.js +1 -1
- package/dist/brand.css +1 -1
- package/dist/charts/BoxPlotChart.js +1 -1
- package/dist/charts/CandlestickChart.js +1 -1
- package/dist/charts/CartesianPlot.js +1 -1
- package/dist/charts/ChartBrush.js +1 -1
- package/dist/charts/ChartFrame.js +1 -1
- package/dist/charts/ChartSkeleton.js +1 -1
- package/dist/charts/ChordChart.js +1 -1
- package/dist/charts/ColumnChart.js +1 -1
- package/dist/charts/FunnelChart.js +1 -1
- package/dist/charts/HeatmapChart.js +1 -1
- package/dist/charts/HistogramChart.js +1 -1
- package/dist/charts/Meter.js +1 -1
- package/dist/charts/PieChart.js +1 -1
- package/dist/charts/RadarChart.js +1 -1
- package/dist/charts/RadialBarChart.js +1 -1
- package/dist/charts/RangeChart.js +1 -1
- package/dist/charts/RankedBars.js +1 -1
- package/dist/charts/SankeyChart.js +1 -1
- package/dist/charts/ScatterChart.js +1 -1
- package/dist/charts/SpecChart.js +1 -1
- package/dist/charts/StatTile.js +1 -1
- package/dist/charts/SunburstChart.js +1 -1
- package/dist/charts/TimeSeriesChart.js +1 -1
- package/dist/charts/TreemapChart.js +1 -1
- package/dist/charts/WaterfallChart.js +1 -1
- package/dist/{chunk-YIV7CFBG.js → chunk-27XV4TAU.js} +5 -5
- package/dist/{chunk-YXOFUY4J.js → chunk-2DOMIOYR.js} +1 -1
- package/dist/{chunk-JAQO3TNE.js → chunk-2OMM2AG3.js} +1 -1
- package/dist/chunk-2T7MZ77B.js +3 -0
- package/dist/{chunk-3LGPZAVU.js → chunk-2XQOK3CT.js} +2 -2
- package/dist/{chunk-E47TNYYE.js → chunk-2YBJQUYQ.js} +1 -1
- package/dist/{chunk-RPFONHXQ.js → chunk-32WEY6O5.js} +1 -1
- package/dist/{chunk-X3NYVMXJ.js → chunk-3CMCGOOV.js} +4 -4
- package/dist/{chunk-NK5RRBXY.js → chunk-3WFJ4PYV.js} +6 -6
- package/dist/{chunk-MBY5JIGB.js → chunk-43MCNASD.js} +1 -1
- package/dist/{chunk-CRO56LVN.js → chunk-4H5NTMOF.js} +1 -1
- package/dist/{chunk-MOBJVNLF.js → chunk-4KJ7MLWO.js} +10 -10
- package/dist/{chunk-LPJGF6LK.js → chunk-4RTDZSGH.js} +17 -17
- package/dist/{chunk-PLDMQNKD.js → chunk-4UGFNTZ3.js} +8 -8
- package/dist/{chunk-HCKCQIWA.js → chunk-53EW4M5S.js} +5 -5
- package/dist/{chunk-HNUKXGYP.js → chunk-56ESGDIC.js} +1 -1
- package/dist/{chunk-OXVRXWJL.js → chunk-5F6KJAF3.js} +11 -11
- package/dist/{chunk-VI4NLOVJ.js → chunk-5N6AC3LN.js} +11 -11
- package/dist/{chunk-KSHNA6W2.js → chunk-5NDONLH5.js} +3 -3
- package/dist/chunk-5THF6BJS.js +6 -0
- package/dist/{chunk-DD2ZGHCG.js → chunk-5V6SA77P.js} +6 -6
- package/dist/{chunk-JSUL7UON.js → chunk-63QLZYMN.js} +5 -5
- package/dist/{chunk-GEQC4ABV.js → chunk-6XC3XX7F.js} +6 -6
- package/dist/{chunk-BUHTLO2K.js → chunk-7EK7JNR4.js} +1 -1
- package/dist/{chunk-SCPPW3ZC.js → chunk-7F4U43YN.js} +4 -4
- package/dist/{chunk-4MERJIJJ.js → chunk-7FBAZLBX.js} +1 -1
- package/dist/{chunk-WRRMZAKK.js → chunk-7H7U3HC6.js} +1 -1
- package/dist/{chunk-LBGRLG3Y.js → chunk-7KIDOIPY.js} +1 -1
- package/dist/{chunk-MQXZZBR6.js → chunk-7ZYEDXZX.js} +1 -1
- package/dist/chunk-A2ZEGD2S.js +11 -0
- package/dist/{chunk-U24GFE5L.js → chunk-ACNDPAAT.js} +1 -1
- package/dist/{chunk-ZKYBLZPT.js → chunk-AJ5NU7UH.js} +8 -8
- package/dist/chunk-AJO55X66.js +6 -0
- package/dist/{chunk-RBINX62X.js → chunk-ANSQT5ZS.js} +1 -1
- package/dist/{chunk-OAZX7ZGB.js → chunk-AQULCKKZ.js} +11 -11
- package/dist/{chunk-DV4B26FJ.js → chunk-B5OYS65L.js} +1 -1
- package/dist/chunk-BD4OHYQB.js +13 -0
- package/dist/{chunk-6KGIHI6X.js → chunk-BFA5U5JF.js} +11 -11
- package/dist/{chunk-CFJL6MML.js → chunk-BFO72WQB.js} +1 -1
- package/dist/{chunk-4ALGGYHV.js → chunk-BPECY7I7.js} +9 -9
- package/dist/{chunk-CCA4LQNB.js → chunk-BXZNMSTZ.js} +1 -1
- package/dist/{chunk-UDVUVFRS.js → chunk-BXZSLRNO.js} +12 -12
- package/dist/{chunk-YAZENY3X.js → chunk-C4XV42QP.js} +1 -1
- package/dist/chunk-CC42UKIT.js +1 -0
- package/dist/{chunk-W4UYDSTI.js → chunk-CD7P34VC.js} +7 -7
- package/dist/{chunk-OMCM3SIE.js → chunk-CENTHUBD.js} +7 -7
- package/dist/{chunk-IS7C6OWZ.js → chunk-CF4YOJUQ.js} +10 -10
- package/dist/{chunk-TF6DYDNQ.js → chunk-CNVYM3HP.js} +1 -1
- package/dist/{chunk-46EBZ7YI.js → chunk-COMV3Z2U.js} +1 -1
- package/dist/chunk-CQCMJHDM.js +9 -0
- package/dist/{chunk-HKPVHSZ3.js → chunk-CRB5GM4W.js} +1 -1
- package/dist/{chunk-PB6XGDLJ.js → chunk-CRU2BNEM.js} +8 -8
- package/dist/{chunk-3YQICVUP.js → chunk-CTW2OKYS.js} +2 -2
- package/dist/chunk-CWTY4GTU.js +5 -0
- package/dist/{chunk-33F35NNM.js → chunk-DKUF7BD5.js} +1 -1
- package/dist/{chunk-EFBWQWUS.js → chunk-DSHEOC2O.js} +1 -1
- package/dist/{chunk-KABXUBIH.js → chunk-DU5IBIZQ.js} +1 -1
- package/dist/{chunk-QTNMALBN.js → chunk-DZBGJ6X4.js} +1 -1
- package/dist/{chunk-YESTUDOK.js → chunk-E227NVFX.js} +1 -1
- package/dist/{chunk-P75R4EYJ.js → chunk-EEVKJJ5S.js} +4 -4
- package/dist/{chunk-NPTHHWXZ.js → chunk-EOGXCGQF.js} +5 -5
- package/dist/{chunk-DW5Y57I2.js → chunk-ESDWHHQY.js} +2 -2
- package/dist/{chunk-EM6VZSNJ.js → chunk-FAIHSCOG.js} +1 -1
- package/dist/chunk-FEJFGFPF.js +8 -0
- package/dist/{chunk-EO3IKZCP.js → chunk-FLYOI6EW.js} +1 -1
- package/dist/{chunk-AQ3LCE2U.js → chunk-FOTDGSY5.js} +1 -1
- package/dist/{chunk-NZISMTQE.js → chunk-FUUJJ7OH.js} +5 -5
- package/dist/chunk-FWUXYNWF.js +13 -0
- package/dist/{chunk-ZYJAZ5HH.js → chunk-G2X5YYIQ.js} +2 -2
- package/dist/chunk-GEZ45J4Z.js +2 -0
- package/dist/{chunk-LJN77RG6.js → chunk-GFBQ53WN.js} +1 -1
- package/dist/chunk-GGSPY3Q4.js +23 -0
- package/dist/{chunk-XNFZLSWW.js → chunk-GIUX7WUS.js} +6 -6
- package/dist/{chunk-ZU432XW4.js → chunk-GJ23UZDQ.js} +1 -1
- package/dist/{chunk-YJOJ5MUZ.js → chunk-GJJKWGBX.js} +6 -6
- package/dist/chunk-GMLGR4R6.js +8 -0
- package/dist/chunk-GRB4LKZC.js +9 -0
- package/dist/chunk-GZJ5F7SB.js +12 -0
- package/dist/chunk-HB2XXIQG.js +6 -0
- package/dist/chunk-HGZZXA2N.js +9 -0
- package/dist/chunk-HICNRXYB.js +11 -0
- package/dist/{chunk-46VLN6KC.js → chunk-HNQKXOFU.js} +4 -4
- package/dist/{chunk-AIJ6OR6X.js → chunk-HS4EWT6L.js} +2 -2
- package/dist/{chunk-GWDTGCQB.js → chunk-HTDZ3XAJ.js} +8 -8
- package/dist/{chunk-A34PD3XT.js → chunk-HY3JYAUH.js} +14 -14
- package/dist/{chunk-S262RGL6.js → chunk-I3QFYBOP.js} +1 -1
- package/dist/{chunk-DSKROZST.js → chunk-I7H3OIYX.js} +1 -1
- package/dist/{chunk-T6BGS26U.js → chunk-IRZ6XM5A.js} +1 -1
- package/dist/{chunk-LISPTWW3.js → chunk-IYPRFUTT.js} +1 -1
- package/dist/{chunk-CRILBBSU.js → chunk-J5ISQYVM.js} +1 -1
- package/dist/{chunk-WPCNJ4UL.js → chunk-JCTOQOVO.js} +1 -1
- package/dist/{chunk-ED5D2O6E.js → chunk-JCUG572K.js} +1 -1
- package/dist/chunk-KHVECW4M.js +7 -0
- package/dist/{chunk-KRH7UAD2.js → chunk-L75RBQFH.js} +1 -1
- package/dist/{chunk-T4WDJ7IB.js → chunk-LJJSFJA2.js} +28 -28
- package/dist/{chunk-4DDL6NXB.js → chunk-LLBH6PHE.js} +1 -1
- package/dist/{chunk-FGWHTNC3.js → chunk-LOEOCZCN.js} +1 -1
- package/dist/{chunk-NIBYHQLT.js → chunk-LTESFDTF.js} +1 -1
- package/dist/{chunk-7P2WKDGB.js → chunk-LUSIZ2BK.js} +15 -15
- package/dist/{chunk-AICGATHE.js → chunk-M7DFM2N7.js} +58 -58
- package/dist/{chunk-2UO47XB4.js → chunk-MRFNJZRR.js} +2 -1
- package/dist/{chunk-XZ2WQNOX.js → chunk-NC36LJCA.js} +10 -10
- package/dist/{chunk-UNJWYV6V.js → chunk-NHBDLW52.js} +2 -2
- package/dist/{chunk-TVRKONNH.js → chunk-NHWDB7R6.js} +1 -1
- package/dist/{chunk-63ZLF7LS.js → chunk-NJTFI7AA.js} +1 -1
- package/dist/chunk-NPQBJJLP.js +9 -0
- package/dist/{chunk-CJ4U4C4A.js → chunk-NZYI4XV5.js} +5 -5
- package/dist/{chunk-JQHL4B4C.js → chunk-ONYPN3JY.js} +12 -12
- package/dist/{chunk-4K7BA3PD.js → chunk-ORLQUGIN.js} +6 -6
- package/dist/{chunk-THSKCKAQ.js → chunk-PH3P54QQ.js} +1 -1
- package/dist/chunk-PKNHSZWK.js +8 -0
- package/dist/{chunk-ZU3BD75E.js → chunk-PXIP246B.js} +1 -1
- package/dist/{chunk-5EWKVVUD.js → chunk-QBD7V4TK.js} +1 -1
- package/dist/{chunk-UIOKWFT4.js → chunk-QN56R4V4.js} +1 -1
- package/dist/{chunk-QMTYILTT.js → chunk-QTMRW6DK.js} +1 -1
- package/dist/{chunk-H3IGNWT7.js → chunk-R3JKZXII.js} +4 -4
- package/dist/{chunk-ZHFKBWBU.js → chunk-R3K3LVVS.js} +1 -1
- package/dist/{chunk-IK37Q6LY.js → chunk-RIXX6NRV.js} +1 -1
- package/dist/{chunk-DWYCSJ6O.js → chunk-RM74EAMV.js} +2 -2
- package/dist/{chunk-TOSUM2OI.js → chunk-RXHTIJ64.js} +1 -1
- package/dist/chunk-S3C3XJG7.js +1 -0
- package/dist/{chunk-6MWLOLLP.js → chunk-SCCAMJB4.js} +1 -1
- package/dist/{chunk-6HO7244M.js → chunk-SCGBCBXP.js} +1 -1
- package/dist/chunk-SX5CSXZO.js +8 -0
- package/dist/{chunk-YQEGMCSX.js → chunk-TBBG2AWY.js} +3 -3
- package/dist/{chunk-A3AKJDLI.js → chunk-TRWHVG3A.js} +1 -1
- package/dist/{chunk-O53EQODF.js → chunk-TTSZSLQL.js} +1 -1
- package/dist/{chunk-RDYFZHT3.js → chunk-UDJLRTQB.js} +1 -1
- package/dist/chunk-UDL2A2GT.js +4 -0
- package/dist/chunk-UE54EN4C.js +2 -0
- package/dist/{chunk-VNAOZVSM.js → chunk-VFBBGLRA.js} +12 -12
- package/dist/{chunk-B7WTHCTF.js → chunk-VGWYAYHB.js} +3 -3
- package/dist/chunk-VPYD7UJM.js +22 -0
- package/dist/{chunk-MSAQGUGU.js → chunk-VQPZDZ3R.js} +4 -4
- package/dist/{chunk-RSPCCVN4.js → chunk-VW7W6LCV.js} +1 -1
- package/dist/{chunk-34AHFST2.js → chunk-VZLYB5LX.js} +1 -1
- package/dist/chunk-WD3I7AEZ.js +14 -0
- package/dist/{chunk-RLTTAH46.js → chunk-WMLBMR4E.js} +4 -4
- package/dist/{chunk-GCRPI3AL.js → chunk-XARBHOEZ.js} +1 -1
- package/dist/{chunk-62RAGXWK.js → chunk-XBDHRMQI.js} +7 -7
- package/dist/{chunk-VPGQMNW3.js → chunk-XQUXL75F.js} +1 -1
- package/dist/{chunk-ZYDRBF3H.js → chunk-XZH5PEML.js} +5 -5
- package/dist/{chunk-GHMDLZH4.js → chunk-Y46WPTKY.js} +7 -7
- package/dist/chunk-YAD7TML2.js +28 -0
- package/dist/{chunk-LXHTCLNX.js → chunk-YKHAI5IZ.js} +1 -1
- package/dist/{chunk-C4T4APD6.js → chunk-YRZP7JN4.js} +22 -22
- package/dist/{chunk-BYLGKRIT.js → chunk-Z43XVU2P.js} +1 -1
- package/dist/{chunk-L6OPXIZN.js → chunk-ZACNIKIQ.js} +1 -1
- package/dist/{chunk-H34KI3HV.js → chunk-ZG3RF2VE.js} +9 -9
- package/dist/{chunk-VOXX4LNC.js → chunk-ZUBTNUVE.js} +1 -1
- package/dist/{chunk-HK4QAI2A.js → chunk-ZYFBV4C7.js} +2 -2
- 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 +666 -666
- 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.js +1 -1
- package/dist/shell/toast.js +1 -1
- package/dist/telemetry/index.js +1 -1
- package/dist/templates/AuthScreen.js +1 -1
- package/dist/templates/ChatTemplate.js +1 -1
- package/dist/templates/CheckoutTemplate.js +1 -1
- package/dist/templates/DashboardTemplate.js +1 -1
- package/dist/templates/DataTablePage.js +1 -1
- package/dist/templates/EmailTemplate.js +1 -1
- package/dist/templates/ErrorBoundary.js +1 -1
- package/dist/templates/ErrorPage.js +1 -1
- package/dist/templates/FormLayoutPage.js +1 -1
- package/dist/templates/GalleryTemplate.js +1 -1
- package/dist/ui/index.js +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/Calculator-TKQRQGTI.js +0 -29
- package/dist/Files-QM5PW6BX.js +0 -88
- package/dist/PdfViewer-3UEC5TNN.js +0 -1
- package/dist/Sidebar-SZ5OGL6C.js +0 -44
- package/dist/chunk-4LNO444F.js +0 -11
- package/dist/chunk-56YJIKVI.js +0 -11
- package/dist/chunk-5PDHKH2A.js +0 -3
- package/dist/chunk-6E47JSLM.js +0 -22
- package/dist/chunk-AEMAGYIZ.js +0 -8
- package/dist/chunk-ATURDO2C.js +0 -14
- package/dist/chunk-D7DRZKUI.js +0 -1
- package/dist/chunk-EJBR5Y4X.js +0 -9
- package/dist/chunk-EZBE3H2W.js +0 -9
- package/dist/chunk-HTB5AEZU.js +0 -9
- package/dist/chunk-IJXMWWTM.js +0 -9
- package/dist/chunk-JINTE3G4.js +0 -1
- package/dist/chunk-K46DLEIX.js +0 -23
- package/dist/chunk-N7GFQZ2J.js +0 -12
- package/dist/chunk-N7LDQZTL.js +0 -8
- package/dist/chunk-NDP2I5HK.js +0 -8
- package/dist/chunk-OMUC6TZT.js +0 -6
- package/dist/chunk-SOWRW647.js +0 -6
- package/dist/chunk-SZC35EYE.js +0 -28
- package/dist/chunk-TLE6VHMJ.js +0 -8
- package/dist/chunk-UMFEOZ75.js +0 -4
- package/dist/chunk-UYNFTF6L.js +0 -2
- package/dist/chunk-WRJP33DN.js +0 -6
- package/dist/chunk-WVIUU4BZ.js +0 -13
- package/dist/chunk-XZU24YKP.js +0 -13
- package/dist/chunk-Y3SVPBUT.js +0 -7
- package/dist/chunk-YN5K72D6.js +0 -5
- package/dist/chunk-ZITMPMUT.js +0 -2
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{useOverlayTarget as e,usePopupAnchor as r,OverlayLayerProvider as t}from"./chunk-3DVNXNTF.js";import{useDiscardGuard as i}from"./chunk-
|
|
2
|
-
return v("button",{type:"button",onClick:e,"aria-label":r.close,className:"rounded-(--radius-control) p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */v(s,{name:"close",className:"h-5 w-5",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})})}function C({open:s,onClose:h,side:C="right",size:
|
|
3
|
-
return x(y,{children:[/* @__PURE__ */v("span",{ref:
|
|
4
|
-
/* @__PURE__ */v(t,{value:
|
|
5
|
-
/* @__PURE__ */v("div",{className:"fixed inset-0 bg-black/30",onClick:
|
|
6
|
-
/* @__PURE__ */x("div",{ref:
|
|
1
|
+
import{useOverlayTarget as e,usePopupAnchor as r,OverlayLayerProvider as t}from"./chunk-3DVNXNTF.js";import{useDiscardGuard as i}from"./chunk-C4XV42QP.js";import{dialogA11y as o}from"./chunk-VWGWZY7A.js";import{useDismissPopupsOnOpen as l}from"./chunk-7QSDPSXP.js";import{useFocusTrap as n,useScrollLock as a}from"./chunk-CDAJKLGL.js";import{Icon as s}from"./chunk-MRFNJZRR.js";import{Z_LAYERS as d}from"./chunk-62LW225J.js";import{useHydrated as c}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as m}from"./chunk-TWVUQUUD.js";import{useShellStrings as h}from"./chunk-43MCNASD.js";import{useRef as f,useId as u,useState as p,useEffect as b}from"react";import{createPortal as g}from"react-dom";import{jsxs as x,Fragment as y,jsx as v}from"react/jsx-runtime";var w={sm:"sm:w-[320px]",md:"sm:w-[448px]",lg:"sm:w-[640px]"},k={right:"inset-y-0 right-0",left:"inset-y-0 left-0",bottom:"inset-x-0 bottom-0"};function N(e,r){const t=window.innerHeight-(r.top+r.height);if("bottom"===e)return{left:r.left,width:r.width,bottom:t};const i={top:r.top,height:r.height};return"left"===e?{...i,left:r.left}:{...i,right:window.innerWidth-(r.left+r.width)}}function j({onClose:e}){const r=h().dialog;/* @__PURE__ */
|
|
2
|
+
return v("button",{type:"button",onClick:e,"aria-label":r.close,className:"rounded-(--radius-control) p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */v(s,{name:"close",className:"h-5 w-5",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})})}function C({open:s,onClose:h,side:C="right",size:D="md",title:W,description:J,footer:L,children:V,blocking:z=!1,dirty:A=!1,initialFocus:F,"aria-label":H,"aria-labelledby":P,"aria-describedby":Q,className:R=""}){const S=f(null),T=u(),U=u(),X=u(),B=e(c()),[G,I]=p(null),M=i({open:s,dirty:A,onClose:h,title:W,layer:G}),Z=f(null),K=r(s&&null!==B,Z);if(l(s),n(S,s&&null!==B,F),a(s),b(()=>{if(s)return m(()=>(z||M(),!0),()=>S.current)},[s,z,M]),!s||!B)return null;const Y="bottom"===C,$={...Y?{maxHeight:"85vh"}:{},...K?N(C,K):{}};/* @__PURE__ */
|
|
3
|
+
return x(y,{children:[/* @__PURE__ */v("span",{ref:Z,hidden:!0,"data-popup-anchor":""}),g(
|
|
4
|
+
/* @__PURE__ */v(t,{value:G,children:/* @__PURE__ */x("div",{ref:I,className:"fixed inset-0",style:{zIndex:d.overlay},role:"presentation","data-overlay-layer":"",children:[
|
|
5
|
+
/* @__PURE__ */v("div",{className:"fixed inset-0 bg-black/30",onClick:z?void 0:M,"aria-hidden":"true"}),
|
|
6
|
+
/* @__PURE__ */x("div",{ref:S,...o({modal:!0,titleId:W?X:void 0,labelledBy:P,label:H}),"aria-describedby":Q??(J?U:V?T:void 0),"data-drawer-side":C,"data-popup-panel":"",style:$,className:["fixed flex flex-col bg-white shadow-xl",Y?"":`w-full max-w-full ${w[D]}`,K?"":k[C],Y?"rounded-t-xl":"",R].filter(Boolean).join(" "),children:[W?/* @__PURE__ */x("div",{className:"flex shrink-0 items-center justify-between gap-4 border-b border-gray-100 px-4 py-3",children:[
|
|
7
7
|
/* @__PURE__ */x("div",{className:"min-w-0",children:[
|
|
8
|
-
/* @__PURE__ */v("h2",{id:
|
|
9
|
-
/* @__PURE__ */x("div",{id:T,className:"min-h-0 flex-1 overflow-y-auto px-4 py-4",children:[
|
|
8
|
+
/* @__PURE__ */v("h2",{id:X,className:"text-base font-semibold text-gray-900",children:W}),J&&/* @__PURE__ */v("p",{id:U,className:"mt-0.5 text-sm text-gray-500",children:J})]}),!z&&/* @__PURE__ */v(j,{onClose:M})]}):!z&&/* @__PURE__ */v("div",{className:"absolute right-2 top-2 z-10",children:/* @__PURE__ */v(j,{onClose:M})}),
|
|
9
|
+
/* @__PURE__ */x("div",{id:T,className:"min-h-0 flex-1 overflow-y-auto px-4 py-4",children:[J&&!W&&/* @__PURE__ */v("p",{id:U,className:("mb-3 text-sm text-gray-500 "+(z?"":"pr-8")).trim(),children:J}),V]}),L&&/* @__PURE__ */v("div",{className:"flex shrink-0 justify-end gap-3 border-t border-gray-100 px-4 py-3",children:L})]})]})}),B)]})}export{C as Drawer};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import{firstEnabledIndex as e,matchTypeahead as t,lastEnabledIndex as r,nextEnabledIndex as i}from"./chunk-EO5RLFRX.js";import{flattenOptionItems as n,groupedRows as a,isOptionGroup as l,OptionCheck as o}from"./chunk-
|
|
2
|
-
/* @__PURE__ */E(
|
|
3
|
-
/* @__PURE__ */E("span",{id:
|
|
4
|
-
return E(I,{children:e.map((e,r)=>(e=>l(e))(e)?/* @__PURE__ */E("optgroup",{label:e.label,children:e.options.map(t)},`group-${r}`):t(e))})}var
|
|
5
|
-
return C("div",{id:$e(t),role:"option",lang:e.description||e.labelStyle||
|
|
1
|
+
import{firstEnabledIndex as e,matchTypeahead as t,lastEnabledIndex as r,nextEnabledIndex as i}from"./chunk-EO5RLFRX.js";import{flattenOptionItems as n,groupedRows as a,isOptionGroup as l,OptionCheck as o}from"./chunk-GFBQ53WN.js";import{useSettingAuto as d}from"./chunk-2NMW66P5.js";import{inputClasses as s,PLACEHOLDER_INK as c}from"./chunk-AYZY3YNC.js";import{useIsMobile as u}from"./chunk-UGTRSRIW.js";import{optionNoteClass as p}from"./chunk-URHGHXDN.js";import{Icon as m}from"./chunk-MRFNJZRR.js";import{onOverlayOpen as v}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as h}from"./chunk-62LW225J.js";import{useDropdownPosition as f,MENU_MAX_HEIGHT as b}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as g}from"./chunk-D65T4H6J.js";import{solidSurfaceStyle as y}from"./chunk-5FYDNH4Y.js";import{registerModalEscapeInterceptor as x}from"./chunk-TWVUQUUD.js";import{useShellStrings as N}from"./chunk-43MCNASD.js";import{forwardRef as k,useId as w,useState as $,useRef as D,useMemo as j,useCallback as S,useEffect as H}from"react";import{createPortal as T}from"react-dom";import{jsxs as C,jsx as E,Fragment as I}from"react/jsx-runtime";var O=e=>e.labelStyle?{lineHeight:1.25,...e.labelStyle}:void 0,z=k(function({value:e,onChange:t,options:r,placeholder:i,invalid:n,className:a="",size:l,touchSize:o,renderOption:c,renderValue:u,valueText:p,readOnly:m,footer:v,changed:h,auto:f,multiple:b,"aria-describedby":g,...y},x){const k=t,$=N(),D=d(),j=f??D,S=w(),H=/* @__PURE__ */C("select",{ref:x,value:e,multiple:b||void 0,onChange:e=>k(b?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),"aria-invalid":n||void 0,"aria-describedby":[g,j?S:void 0].filter(Boolean).join(" ")||void 0,className:s({invalid:n,size:l,auto:j,className:`pr-8 ${a}`.trim()}),...y,children:[void 0!==i&&!b&&/* @__PURE__ */E("option",{value:"",disabled:!0,children:i}),
|
|
2
|
+
/* @__PURE__ */E(R,{items:r})]});return j?/* @__PURE__ */C(I,{children:[H,
|
|
3
|
+
/* @__PURE__ */E("span",{id:S,hidden:!0,children:$.settingView.auto})]}):H});function R({items:e}){const t=e=>/* @__PURE__ */E("option",{value:e.value,disabled:e.disabled,lang:e.lang,children:e.label},e.value);/* @__PURE__ */
|
|
4
|
+
return E(I,{children:e.map((e,r)=>(e=>l(e))(e)?/* @__PURE__ */E("optgroup",{label:e.label,children:e.options.map(t)},`group-${r}`):t(e))})}var A=k(function({value:l,onChange:u,options:k,placeholder:z,invalid:A,className:B="",id:U,disabled:F,size:K,touchSize:M,title:V,multiple:W,renderOption:P,renderValue:Y,valueText:G,readOnly:L=!1,footer:J,changed:q=!1,auto:Q,"aria-describedby":X,"aria-label":Z,"aria-labelledby":_,...ee},te){const[re,ie]=$(!1),[ne,ae]=$(-1),le=D(null),oe=D(null),de=D(null),se=D(null),ce=D([]),ue=()=>se.current??de.current,pe=!!J?.length,me="sm"===K,ve=me?"min-h-7 px-3 py-1 text-xs leading-4":"min-h-(--row-height-menu) px-3 py-2 text-sm leading-5",he=p(me),[fe,be]=$(null),ge=N(),ye=D(re);ye.current=re;const xe=D({buffer:"",timer:null}),Ne=w(),ke=`${Ne}-listbox`,we=U??`${Ne}-trigger`,$e=e=>`${Ne}-opt-${e}`,De=`${Ne}-changed`,je=d(),Se=Q??je,He=`${Ne}-auto`,Te=[X,q?De:void 0,Se?He:void 0].filter(Boolean).join(" ")||void 0,Ce=j(()=>n(k),[k]),Ee=W?l:[],Ie=u,Oe=f(oe,re,{matchTriggerWidth:!0,...J?.length?{preferredMaxHeight:Number.POSITIVE_INFINITY}:{}}),ze=`${re}|${Oe?.top}|${Oe?.bottom}|${Oe?.maxHeight}|${k.length}`;g(()=>{be(null)},[ze]),g(()=>{const e=de.current;if(!re||!e||null!==fe)return;if(e.scrollHeight<=e.clientHeight+1)return;const t=getComputedStyle(e),r=parseFloat(t.paddingTop)||0;parseFloat(t.paddingBottom);const i=e.getBoundingClientRect().top;let n=0;for(const t of e.querySelectorAll('[role="option"]')){const r=t.getBoundingClientRect().bottom-i+e.scrollTop;if(!(r<=e.clientHeight+.5))break;n=r}n>r&&be(Math.floor(n))},[re,fe,ze]);const Re=W?Ce.findIndex(e=>Ee.includes(e.value)):Ce.findIndex(e=>e.value===l),Ae=W?Ce.filter(e=>Ee.includes(e.value)).map(e=>e.label).join(", ")||void 0:Re>=0?Ce[Re].label:void 0,Be=!W&&Re>=0?Ce[Re].lang:void 0,Ue=W?Ce.filter(e=>Ee.includes(e.value)):Re>=0?[Ce[Re]]:[],Fe=Y&&Ue.length?Y(Ue):void 0,Ke=void 0!==Fe&&G?G(Ue):void 0,Me=S((e=!0)=>{ie(!1),ae(-1),e&&oe.current?.focus()},[]),Ve=S(()=>{F||L||(ae(Re>=0?Re:e(Ce)),ie(!0))},[F,L,Ce,Re]),We=S(e=>{const t=Ce[e];if(t&&!t.disabled){if(W){const r=l;return Ie(r.includes(t.value)?r.filter(e=>e!==t.value):[...r,t.value]),void ae(e)}Ie(t.value),Me()}},[Ce,W,l,Ie,Me]);H(()=>{if(!re)return;return x(e=>!("Escape"!==e.key||!ye.current)&&(Me(),!0),ue)},[re,Me]),H(()=>{if(!re)return;const e=e=>{const t=e.target;le.current?.contains(t)||ue()?.contains(t)||Me(!1)};document.addEventListener("pointerdown",e);const t=v(()=>Me(!1));return()=>{document.removeEventListener("pointerdown",e),t()}},[re,Me]),H(()=>{!re||ne<0||de.current?.querySelector(`#${CSS.escape($e(ne))}`)?.scrollIntoView({block:"nearest"})},[re,ne]);const Pe=S(e=>{const r=xe.current;r.timer&&clearTimeout(r.timer),r.buffer+=e,r.timer=setTimeout(()=>{r.buffer="",r.timer=null},500);const i=re?ne:Re,n=t(Ce,r.buffer,i);n<0||(re?ae(n):W?(ae(n),ie(!0)):We(n))},[re,ne,Re,Ce,We,W]),Ye=re?a(k,(e,t)=>{const r=(i=e.value,W?Ee.includes(i):l===i);var i;const n=t===ne;/* @__PURE__ */
|
|
5
|
+
return C("div",{id:$e(t),role:"option",lang:e.description||e.labelStyle||P?void 0:e.lang,"aria-selected":r,"aria-disabled":e.disabled||void 0,onPointerEnter:()=>{e.disabled||ae(t)},onClick:()=>We(t),className:`mx-1 cursor-pointer truncate rounded-lg ${ve}${W?" flex items-center gap-2":""}\n ${e.disabled?"cursor-not-allowed text-gray-400":n?"bg-blue-50 text-blue-700":r?"font-medium text-blue-600":"text-gray-700"}`,children:[W&&/* @__PURE__ */E(o,{selected:r}),P?/* @__PURE__ */E("span",{className:"block min-w-0 flex-1 truncate",children:P(e,{selected:r,active:n})}):W?/* @__PURE__ */C("span",{className:"block min-w-0 flex-1",children:[
|
|
6
6
|
/* @__PURE__ */E("span",{lang:e.lang,className:"block truncate",style:O(e),children:e.label}),e.description&&/* @__PURE__ */E("span",{className:he,children:e.description})]}):e.description||e.labelStyle?
|
|
7
7
|
/* @__PURE__ */C(I,{children:[
|
|
8
|
-
/* @__PURE__ */E("span",{lang:e.lang,className:"block truncate",style:O(e),children:e.label}),e.description&&/* @__PURE__ */E("span",{className:he,children:e.description})]}):e.label]},e.value)},
|
|
8
|
+
/* @__PURE__ */E("span",{lang:e.lang,className:"block truncate",style:O(e),children:e.label}),e.description&&/* @__PURE__ */E("span",{className:he,children:e.description})]}):e.label]},e.value)},Ne,"mx-1"):null,Ge=void 0!==Fe?
|
|
9
9
|
/* @__PURE__ */C("span",{className:"relative block min-w-0 truncate",children:[
|
|
10
|
-
/* @__PURE__ */E("span",{"aria-hidden":"true","data-select-value":"",className:"flex min-w-0 items-center gap-2 truncate",children:
|
|
11
|
-
/* @__PURE__ */E("span",{lang:void 0===
|
|
12
|
-
/* @__PURE__ */E("div",{className:"shrink-0 border-t border-(--rosh-glass-solid-border) px-1 py-1",children:J.map((e,t)=>/* @__PURE__ */C("button",{ref:e=>{ce.current[t]=e},type:"button","data-select-action":"","aria-disabled":e.disabled||void 0,onClick:()=>(e=>{e.disabled||(
|
|
10
|
+
/* @__PURE__ */E("span",{"aria-hidden":"true","data-select-value":"",className:"flex min-w-0 items-center gap-2 truncate",children:Fe}),
|
|
11
|
+
/* @__PURE__ */E("span",{lang:void 0===Ke?Be:void 0,className:"sr-only",children:Ke??Ae})]}):/* @__PURE__ */E("span",{lang:Be,className:`block truncate ${void 0===Ae?c:""}`,children:Ae??z??" "}),Le={zIndex:h.popup,left:Oe?.left,top:Oe?.top,bottom:Oe?.bottom,width:Oe?.width,maxHeight:Oe?.maxHeight??b,visibility:Oe?void 0:"hidden",...y()},Je=/* @__PURE__ */E("div",{ref:de,id:ke,role:"listbox","aria-labelledby":_??(Z?void 0:we),"aria-label":_?void 0:Z,"aria-multiselectable":W||void 0,className:pe?"min-h-0 shrink overflow-y-auto py-1":"fixed overflow-y-auto rounded-(--radius-popup) py-1",style:pe?null!==fe?{maxHeight:fe}:void 0:null!==fe?{...Le,maxHeight:fe}:Le,children:Ye}),qe=pe?/* @__PURE__ */C("div",{ref:se,className:"fixed flex flex-col overflow-hidden rounded-(--radius-popup)",style:Le,children:[Je,
|
|
12
|
+
/* @__PURE__ */E("div",{className:"shrink-0 border-t border-(--rosh-glass-solid-border) px-1 py-1",children:J.map((e,t)=>/* @__PURE__ */C("button",{ref:e=>{ce.current[t]=e},type:"button","data-select-action":"","aria-disabled":e.disabled||void 0,onClick:()=>(e=>{e.disabled||(Me(),e.onSelect())})(e),onKeyDown:e=>((e,t)=>{const r=(J?.length??0)-1,i=t=>{e.preventDefault(),ce.current[t]?.focus()},n=()=>{e.preventDefault(),oe.current?.focus()};switch(e.key){case"ArrowDown":return void i(Math.min(t+1,r));case"ArrowUp":return void(0===t?n():i(t-1));case"Home":return void i(0);case"End":return void i(r);case"Tab":return e.shiftKey?void(0===t?n():i(t-1)):t<r?void i(t+1):(e.preventDefault(),void Me());case"Escape":return e.preventDefault(),e.stopPropagation(),void Me()}})(e,t),className:`flex w-full items-center gap-2 rounded-lg ${ve} text-left rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] ${e.disabled?"cursor-not-allowed text-ink-faintest":"cursor-pointer text-ink hover:bg-accent-tint hover:text-blue-700"}`,children:[e.icon&&/* @__PURE__ */E(m,{name:e.icon,"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),
|
|
13
13
|
/* @__PURE__ */E("span",{className:"min-w-0 flex-1 truncate",children:e.label})]},e.label))})]}):Je;/* @__PURE__ */
|
|
14
14
|
return C("div",{ref:le,className:"relative",children:[
|
|
15
|
-
/* @__PURE__ */E("button",{ref:oe,id:we,type:"button",role:"combobox","aria-haspopup":"listbox","aria-expanded":re,"aria-controls":re?
|
|
16
|
-
/* @__PURE__ */C("span",{className:"flex min-w-0 items-center gap-1",children:[
|
|
17
|
-
/* @__PURE__ */E("span",{"aria-hidden":"true","data-select-changed":"",className:"shrink-0",children:"*"})]}):
|
|
18
|
-
/* @__PURE__ */C("select",{ref:te,value:l,multiple:
|
|
19
|
-
/* @__PURE__ */E(
|
|
15
|
+
/* @__PURE__ */E("button",{ref:oe,id:we,type:"button",role:"combobox","aria-haspopup":"listbox","aria-expanded":re,"aria-controls":re?ke:void 0,"aria-activedescendant":re&&ne>=0?$e(ne):void 0,"aria-invalid":A||void 0,"aria-describedby":Te,"aria-label":Z,"aria-labelledby":_,title:V,disabled:F,"aria-readonly":L||void 0,onClick:()=>re?Me():Ve(),onKeyDown:t=>{if(!F&&!L)switch(t.key){case"ArrowDown":return t.preventDefault(),void(re?ae(e=>i(Ce,e,1)):Ve());case"ArrowUp":return t.preventDefault(),void(re?ae(e=>i(Ce,e,-1)):Ve());case"Home":return void(re&&(t.preventDefault(),ae(e(Ce))));case"End":return void(re&&(t.preventDefault(),ae(r(Ce))));case"Enter":return void(re&&(t.preventDefault(),We(ne)));case" ":return t.preventDefault(),void(re?We(ne):Ve());case"Escape":return void(re&&(t.preventDefault(),t.stopPropagation(),Me()));case"Tab":return re&&pe&&!t.shiftKey?(t.preventDefault(),void ce.current[0]?.focus()):void(re&&Me(!1));default:1!==t.key.length||t.metaKey||t.ctrlKey||t.altKey||(t.preventDefault(),Pe(t.key))}},className:s({invalid:A,size:K,readOnly:L,auto:Se,className:`${L?"":"pr-8 "}text-left ${B}`.trim()}),children:q?
|
|
16
|
+
/* @__PURE__ */C("span",{className:"flex min-w-0 items-center gap-1",children:[Ge,
|
|
17
|
+
/* @__PURE__ */E("span",{"aria-hidden":"true","data-select-changed":"",className:"shrink-0",children:"*"})]}):Ge}),q&&/* @__PURE__ */E("span",{id:De,hidden:!0,children:ge.select.changed}),Se&&/* @__PURE__ */E("span",{id:He,hidden:!0,children:ge.settingView.auto}),!L&&/* @__PURE__ */E(m,{name:"chevron-up-down","aria-hidden":"true",className:`pointer-events-none absolute right-2.5 top-1/2 h-4 w-4 -translate-y-1/2 ${c}`,strokeWidth:2}),
|
|
18
|
+
/* @__PURE__ */C("select",{ref:te,value:l,multiple:W||void 0,onChange:e=>Ie(W?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),disabled:F,"aria-hidden":"true",tabIndex:-1,className:"sr-only",...ee,children:[void 0!==z&&!W&&/* @__PURE__ */E("option",{value:"",disabled:!0,children:z}),
|
|
19
|
+
/* @__PURE__ */E(R,{items:k})]}),re&&T(qe,document.body)]})}),B=k(function({touchSize:e,...t},r){const i=u(),n=e??"touch";return!i||void 0===t.footer&&void 0===t.changed||t.readOnly?i&&!t.readOnly?/* @__PURE__ */E(z,{ref:r,...t,size:n}):/* @__PURE__ */E(A,{ref:r,...t}):/* @__PURE__ */E(A,{ref:r,...t,size:n})});export{z as NativeSelect,B as Select_default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{ShellStringsProvider as t}from"./chunk-
|
|
1
|
+
import{ShellStringsProvider as t}from"./chunk-43MCNASD.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{Card as e}from"./chunk-
|
|
1
|
+
import{Card as e}from"./chunk-EOGXCGQF.js";import{FormField as t}from"./chunk-6KBDNYRW.js";import{Checkbox_default as r}from"./chunk-CGZBDI6C.js";import{Input_default as l}from"./chunk-56ESGDIC.js";import{Button_default as a}from"./chunk-EOVXFXVV.js";import{useState as i}from"react";import{jsx as c,jsxs as n,Fragment as s}from"react/jsx-runtime";var o={login:{title:"Welcome back",subtitle:"Sign in to your account",cta:"Sign in"},register:{title:"Create your account",subtitle:"Start your 14-day free trial",cta:"Create account"},forgot:{title:"Reset password",subtitle:"We'll email you a reset link",cta:"Send reset link"}};function m({mode:m="login"}){const[u,d]=i(!0),h=o[m];/* @__PURE__ */
|
|
2
2
|
return c("div",{className:"flex h-full items-center justify-center overflow-auto bg-gray-50 p-6",children:/* @__PURE__ */n("div",{className:"w-full max-w-sm",children:[
|
|
3
3
|
/* @__PURE__ */n("div",{className:"mb-6 text-center",children:[
|
|
4
4
|
/* @__PURE__ */c("div",{className:"mx-auto mb-3 flex h-10 w-10 items-center justify-center rounded-lg bg-blue-600 text-sm font-bold text-white",children:"A"}),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{DropdownMenu as e}from"./chunk-
|
|
1
|
+
import{DropdownMenu as e}from"./chunk-FUUJJ7OH.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{TICK_INK as e}from"./chunk-URBCGEXG.js";import{useShellStrings as n}from"./chunk-
|
|
1
|
+
import{TICK_INK as e}from"./chunk-URBCGEXG.js";import{useShellStrings as n}from"./chunk-43MCNASD.js";import{jsxs as r,jsx as i}from"react/jsx-runtime";function a({ink:e}){/* @__PURE__ */
|
|
2
2
|
return i("span",{"aria-hidden":"true",className:`h-3 w-0.5 shrink-0 rounded-[1px] ${e}`})}function t({link:t,className:l=""}){const c=n().meter;/* @__PURE__ */
|
|
3
3
|
return r("div",{className:`flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-gray-500 ${l}`.trim(),children:[
|
|
4
4
|
/* @__PURE__ */r("span",{className:"inline-flex items-center gap-1",children:[
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Icon as e}from"./chunk-
|
|
1
|
+
import{Icon as e}from"./chunk-MRFNJZRR.js";import{jsx as t,jsxs as r}from"react/jsx-runtime";var a=()=>/* @__PURE__ */t(e,{name:"check",className:"h-3.5 w-3.5","aria-hidden":"true"});function i({items:e,value:i,onChange:n,"aria-label":l,className:s=""}){const c=Math.max(0,e.findIndex(e=>e.id===i));/* @__PURE__ */
|
|
2
2
|
return t("ol",{"aria-label":l,className:`grid items-start ${s}`.trim(),style:{gridTemplateColumns:`repeat(${Math.max(e.length,1)}, minmax(0, 1fr))`},children:e.map((i,l)=>{const s=l<c?"complete":l===c?"current":"upcoming",o="complete"===s&&!!n,m=/* @__PURE__ */t("span",{"aria-hidden":"true",className:["flex h-7 w-7 shrink-0 items-center justify-center rounded-full text-xs font-semibold transition-colors","complete"===s?"bg-blue-600 text-white":"","current"===s?"border-2 border-blue-600 bg-white text-blue-600":"","upcoming"===s?"border-2 border-gray-300 bg-white text-gray-400":""].filter(Boolean).join(" "),children:"complete"===s?/* @__PURE__ */t(a,{}):l+1}),d=/* @__PURE__ */r("span",{className:"min-w-0 text-center",children:[
|
|
3
3
|
/* @__PURE__ */t("span",{className:"block text-sm font-medium "+("upcoming"===s?"text-gray-400":"text-gray-900"),children:i.label}),i.description&&/* @__PURE__ */t("span",{className:"block text-xs text-gray-500",children:i.description})]});/* @__PURE__ */
|
|
4
4
|
return r("li",{"aria-current":"current"===s?"step":void 0,className:"relative flex min-w-0 justify-center",children:[l<e.length-1&&/* @__PURE__ */t("span",{"aria-hidden":"true",className:"absolute top-3.5 h-0.5 rounded "+(l<c?"bg-blue-600":"bg-gray-200"),style:{left:"calc(50% + 0.875rem)",right:"calc(-50% + 0.875rem)"}}),o?/* @__PURE__ */r("button",{type:"button",onClick:()=>n?.(i.id),className:"relative z-10 flex min-w-0 flex-col items-center gap-2 rounded px-2 text-center rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:[m,d]}):/* @__PURE__ */r("span",{className:"relative z-10 flex min-w-0 flex-col items-center gap-2 px-2 text-center",children:[m,d]})]},i.id)})})}export{i as Stepper};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Input_default as e}from"./chunk-
|
|
1
|
+
import{Input_default as e}from"./chunk-56ESGDIC.js";import{useState as r,useRef as t}from"react";import{jsx as o}from"react/jsx-runtime";function n({value:n,label:a,onDone:u}){const[l,c]=r(n),i=t(!1),p=e=>{i.current||(i.current=!0,u(e))};/* @__PURE__ */
|
|
2
2
|
return o(e,{size:"sm",autoFocus:!0,"aria-label":a,value:l,onChange:e=>c(e.target.value),onFocus:e=>e.currentTarget.select(),onKeyDown:e=>{e.stopPropagation(),"Enter"===e.key?(e.preventDefault(),p(l.trim()||n)):"Escape"===e.key&&(e.preventDefault(),p(null))},onBlur:()=>p(l.trim()||n),onClick:e=>e.stopPropagation()})}export{n as RenameField};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Icon as e}from"./chunk-
|
|
1
|
+
import{Icon as e}from"./chunk-MRFNJZRR.js";import{useShellStrings as r}from"./chunk-43MCNASD.js";import{jsxs as t,jsx as n,Fragment as i}from"react/jsx-runtime";var a={info:{box:"bg-blue-50 border-blue-200",icon:"text-blue-600"},success:{box:"bg-green-50 border-green-200",icon:"text-green-600"},warning:{box:"bg-amber-50 border-amber-200",icon:"text-amber-600"},danger:{box:"bg-red-50 border-red-200",icon:"text-red-600"},neutral:{box:"bg-[var(--status-neutral-soft)] border-[color:var(--line)]",icon:"text-[color:var(--status-neutral-soft-ink)]"}},s={info:"bg-blue-700 border-blue-700 text-white",success:"bg-green-700 border-green-700 text-white",warning:"bg-amber-700 border-amber-700 text-white",danger:"bg-red-700 border-red-700 text-white",neutral:"bg-[var(--status-neutral-solid)] border-[color:var(--status-neutral-solid)] text-[color:var(--status-on-solid)]"};function o({tone:r}){const t={className:"h-5 w-5","aria-hidden":!0};switch(r){case"success":/* @__PURE__ */
|
|
2
2
|
return n(e,{name:"check-circle",look:"mini",...t});case"warning":/* @__PURE__ */
|
|
3
3
|
return n(e,{name:"warning",look:"mini",...t});case"danger":/* @__PURE__ */
|
|
4
4
|
return n(e,{name:"close-circle",look:"mini",...t});default:/* @__PURE__ */
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{writeClipboard as e}from"./chunk-PH3P54QQ.js";import{IconButton_default as r}from"./chunk-LE5LWALR.js";import{toast_default as t}from"./chunk-TRWHVG3A.js";import{Icon as n}from"./chunk-MRFNJZRR.js";import{useShellStrings as a}from"./chunk-43MCNASD.js";import{useState as i,useRef as o,useEffect as c,useCallback as l}from"react";import{jsxs as m,jsx as s,Fragment as d}from"react/jsx-runtime";var u={bordered:"border border-gray-300 bg-white",flat:"bg-gray-100"},p={sm:{box:"gap-2 px-3 py-1 text-xs",button:"-my-1"},md:{box:"gap-2 px-3 min-h-8 py-1 text-sm",button:"-my-0.5"}};function b(){/* @__PURE__ */
|
|
2
|
+
return s(n,{name:"copy",className:"h-4 w-4","aria-hidden":"true"})}function h(){/* @__PURE__ */
|
|
3
|
+
return s(n,{name:"check",className:"h-4 w-4 text-green-600","aria-hidden":"true"})}function y({value:n,children:y,symbol:f,label:x,size:g="md",variant:N="bordered",hideCopyButton:k=!1,onCopy:v,multiline:w=!1,id:j,"aria-describedby":R,className:C=""}){const[L,T]=i(!1),A=o(null),B=a().copy;c(()=>()=>{A.current&&clearTimeout(A.current)},[]);const H=l(async()=>{await e(n)?(T(!0),A.current&&clearTimeout(A.current),A.current=setTimeout(()=>{T(!1),A.current=null},2e3),v?.(n)):t.error(B.failed)},[n,v,B]),{box:M,button:P}=p[g],Q=!k;/* @__PURE__ */
|
|
4
|
+
return m("div",{id:Q?void 0:j,"aria-describedby":Q?void 0:R,className:["inline-flex max-w-full items-center rounded-md",u[N],M,C].filter(Boolean).join(" "),children:[null!=f&&""!==f&&/* @__PURE__ */s("span",{"aria-hidden":"true",className:"shrink-0 select-none font-mono text-gray-400",children:f}),
|
|
5
|
+
/* @__PURE__ */s("span",{className:"min-w-0 font-mono text-gray-800 "+(w?"whitespace-pre-wrap break-all":"truncate"),title:w?void 0:n,children:y??n}),!k&&/* @__PURE__ */m(d,{children:[
|
|
6
|
+
/* @__PURE__ */s(r,{id:j,"aria-label":x?B.copyLabel(x):B.copy,"aria-describedby":R,onClick:H,className:`${P} text-gray-400`,children:/* @__PURE__ */s(L?h:b,{})}),
|
|
7
|
+
/* @__PURE__ */s("span",{"aria-live":"polite",className:"sr-only",children:L?B.copied:""})]})]})}export{y as Snippet};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{GROUP_COLORS as e,BADGE_PILL as o}from"./chunk-FZM3ZPW3.js";import{Icon as i}from"./chunk-
|
|
1
|
+
import{GROUP_COLORS as e,BADGE_PILL as o}from"./chunk-FZM3ZPW3.js";import{Icon as i}from"./chunk-MRFNJZRR.js";import{OneLineLabel as r}from"./chunk-WGLHB6WE.js";import{useShellStrings as s}from"./chunk-43MCNASD.js";import{jsxs as t,jsx as n}from"react/jsx-runtime";function l({colorClass:l,tone:c,children:a,size:m="sm",capitalize:p=!1,closable:u=!1,onClose:f,closeLabel:h,className:x=""}){const d=l??e[c??"neutral"],y="xs"===m?"px-2 py-0.5 text-3xs":"md"===m?"px-3 py-0.5 text-xs":"px-2 py-0.5 text-xs",b=p?"capitalize":"",g=s().badge,j=h??("string"==typeof a?g.removeItem(a):g.remove),k="xs"===m?"h-2.5 w-2.5":"h-3 w-3";/* @__PURE__ */
|
|
2
2
|
return t("span",{className:[o,"font-medium",y,b,d,x].filter(Boolean).join(" "),children:[
|
|
3
3
|
/* @__PURE__ */n(r,{children:a}),u&&/* @__PURE__ */n("button",{type:"button",onClick:f,"aria-label":j,className:"-mr-0.5 ml-1 inline-flex shrink-0 items-center justify-center rounded-full opacity-70 transition-opacity hover:opacity-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-strong)]",children:/* @__PURE__ */n(i,{name:"close",look:"mini",className:k,"aria-hidden":"true"})})]})}export{l as ColoredBadge};
|
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
import{toast_default as e}from"./chunk-
|
|
1
|
+
import{toast_default as e}from"./chunk-TRWHVG3A.js";import{useShellStrings as t}from"./chunk-43MCNASD.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),P=r(null),$=t().annotator,E=r($);E.current=$;const[I,S]=o("select"),[W,B]=o(u[0]),[R,j]=o(4),[H,T]=o(24),[F,A]=o(h[0].id),[U,O]=o(!0),[K,V]=o(!1),[Z,G]=o(!1),[X,q]=o(null),[Y,_]=o(null),[J,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"===I&&Me&&("color"in Me&&B(Me.color),"stroke"in Me&&j(Me.stroke),"rect"===Me.type&&te(Me.radius),"text"===Me.type&&(T(Me.size),A(Me.font),O(Me.bold),V(Me.italic),G(Me.underline),q(Me.borderColor),_(Me.background),Q(Me.padding)))},[oe]),a(()=>{const t=new Image;t.crossOrigin="anonymous",t.onload=()=>{P.current=t,le({w:t.naturalWidth,h:t.naturalHeight}),re([]),ie(null)},t.onerror=()=>e.error(E.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=P.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(I,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,I,W,R,ee]);a(()=>{const e=e=>{if(!document.activeElement||!/^(INPUT|TEXTAREA)$/.test(document.activeElement.tagName))return!e.metaKey&&!e.ctrlKey||"z"!==e.key&&"Z"!==e.key||e.shiftKey?void(oe&&("Delete"===e.key||"Backspace"===e.key?(e.preventDefault(),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=>{q(e),oe&&re(t=>t.map(t=>t.id===oe&&"text"===t.type?{...t,borderColor:e}:t))},Pe=e=>{_(e),oe&&re(t=>t.map(t=>t.id===oe&&"text"===t.type?{...t,background:e}:t))},$e=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:F,bold:U,italic:K,underline:Z,borderColor:X,background:Y,padding:J};re(t=>[...t,e]),ie(e.id),S("select")}ye(null)},Ee=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 Ee();t&&t.toBlob(t=>{if(!t)return void e.error(E.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(E.current.clipboardUnsupported);const t=await Ee();t&&t.toBlob(async t=>{if(t)try{await navigator.clipboard.write([new ClipboardItem({"image/png":t})]),e.success(E.current.copied)}catch{e.error(E.current.copyRefused)}else e.error(E.current.copyFailed)},"image/png")}}),[ae,x]);const Ie=i(()=>[{id:"select",label:$.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:$.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:$.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:$.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:$.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:$.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:$.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:$.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"})})}],[$]),Se=e=>"p-2 rounded transition-colors "+(e?"bg-blue-500 text-on-accent":"text-ink hover:bg-gray-200"),We=Me?.type??("select"===I?null:I),Be="rect"===We||"circle"===We||"arrow"===We||"draw"===We,Re="rect"===We,je="text"===We;/* @__PURE__ */
|
|
2
2
|
return 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:[Ie.map(e=>/* @__PURE__ */c("button",{onClick:()=>{S(e.id),ie(null)},title:e.label,className:Se(I===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:$.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:$.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:
|
|
18
|
-
/* @__PURE__ */c("button",{onClick:()=>ze("bold"),className:Se(U),title
|
|
19
|
-
/* @__PURE__ */c("button",{onClick:()=>ze("italic"),className:Se(K),title
|
|
20
|
-
/* @__PURE__ */c("button",{onClick:()=>ze("underline"),className:Se(Z),title
|
|
17
|
+
/* @__PURE__ */c("select",{value:F,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:$[e.name]},e.id))}),
|
|
18
|
+
/* @__PURE__ */c("button",{onClick:()=>ze("bold"),className:Se(U),title:$.bold,children:/* @__PURE__ */c("span",{className:"font-bold",children:$.boldLetter})}),
|
|
19
|
+
/* @__PURE__ */c("button",{onClick:()=>ze("italic"),className:Se(K),title:$.italic,children:/* @__PURE__ */c("span",{className:"italic",children:$.italicLetter})}),
|
|
20
|
+
/* @__PURE__ */c("button",{onClick:()=>ze("underline"),className:Se(Z),title:$.underline,children:/* @__PURE__ */c("span",{className:"underline",children:$.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:H,onChange:e=>{return t=Number(e.target.value),
|
|
22
|
+
/* @__PURE__ */c("span",{children:$.size}),
|
|
23
|
+
/* @__PURE__ */c("input",{type:"range",min:10,max:96,step:1,value:H,onChange:e=>{return t=Number(e.target.value),T(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
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:$.border}),X?/* @__PURE__ */s(d,{children:[
|
|
27
|
+
/* @__PURE__ */c("input",{type:"color",value:X,onChange:e=>De(e.target.value),title:$.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:$.removeBorder,className:"px-0.5 text-gray-400 hover:text-gray-700",children:"✕"})]}):/* @__PURE__ */c("button",{onClick:()=>De(W),title:$.addBorder,className:"px-2 py-0.5 rounded border border-line-strong text-gray-600 hover:bg-gray-100",children:$.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:
|
|
32
|
-
/* @__PURE__ */c("button",{onClick:()=>
|
|
30
|
+
/* @__PURE__ */c("span",{children:$.fill}),Y?/* @__PURE__ */s(d,{children:[
|
|
31
|
+
/* @__PURE__ */c("input",{type:"color",value:Y,onChange:e=>Pe(e.target.value),title:$.fillColor,className:"h-5 w-6 rounded border border-gray-300 bg-white p-0 cursor-pointer"}),
|
|
32
|
+
/* @__PURE__ */c("button",{onClick:()=>Pe(null),title:$.removeFill,className:"px-0.5 text-gray-400 hover:text-gray-700",children:"✕"})]}):/* @__PURE__ */c("button",{onClick:()=>Pe("#ffffff"),title:$.addFill,className:"px-2 py-0.5 rounded border border-line-strong text-gray-600 hover:bg-gray-100",children:$.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:$.padding}),
|
|
35
|
+
/* @__PURE__ */c("input",{type:"range",min:0,max:40,step:1,value:J,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:J})]})]}),
|
|
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:$.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:$.zoomIn,children:"+"}),
|
|
41
|
+
/* @__PURE__ */c("button",{onClick:()=>ue(1),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-700",title:$.fitHint,children:$.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:$.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
|
|
45
|
+
/* @__PURE__ */c("button",{onClick:()=>{if(!me||!P.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(P.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=()=>{P.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:$.applyCrop}),
|
|
46
|
+
/* @__PURE__ */c("button",{onClick:()=>ge(null),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-700",children:$.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:$.cancel}),
|
|
47
|
+
/* @__PURE__ */c("button",{onClick:async()=>{const t=await Ee();t?t.toBlob(t=>{t?m(t):e.error(E.current.exportFailed)},"image/png"):e.error(E.current.exportFailed)},className:"px-3 py-1 rounded bg-blue-500 text-white hover:bg-blue-600 text-xs font-medium",children:$.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"===I?"default":"text"===I?"text":"crosshair"},onPointerDown:e=>{if("select"===I)return void ie(null);if("text"===I){if(xe)return void $e();const t=Ce(e);return void ye({x:t.x,y:t.y,value:""})}const t=Ce(e);if("crop"!==I){if("draw"===I)return Le({kind:"pen",points:[t]}),void pe({id:"",type:"draw",points:[t],color:W,stroke:R});pe(b(I,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"===I&&(e.stopPropagation(),ie(t.id),Le({kind:"move",id:t.id,start:Ce(e),original:t}))})(t,e),onDoubleClick:()=>{var t;"text"===(t=e).type&&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===F)?.css??h[0].css,bold:U,italic:K,underline:Z,borderColor:X,background:Y,padding:J,scale:ke,onChange:e=>ye({...xe,value:e}),onCommit:$e,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"===I?oe?$.hintSelected:$.hintSelect:"text"===I?$.hintText:"crop"===I?$.hintCrop:"draw"===I?$.hintDraw:$.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{PopupMenuDivider as e,PopupMenuLabel as l,menuTextRowStyle as t,PopupSubmenu as i,itemLook as a,MenuCheckMark as r}from"./chunk-
|
|
1
|
+
import{PopupMenuDivider as e,PopupMenuLabel as l,menuTextRowStyle as t,PopupSubmenu as i,itemLook as a,MenuCheckMark as r}from"./chunk-BFA5U5JF.js";import{jsx as n,jsxs as s}from"react/jsx-runtime";var d=e=>!!e&&"label"!==e.type&&"status"!==e.type&&"divider"!==e.type&&!e.disabled,c=(e,l)=>`${e}-status-${l}`;function o(e,l){return e.flatMap((e,t)=>"status"===e.type?[c(l,t)]:[]).join(" ")||void 0}function u(d,o){const{menuId:y,choose:b,toggle:h,followLink:p,rowProps:m=()=>({}),linkAs:k}=o,f=k??"a",v=(d,k)=>{if("divider"===d.type)/* @__PURE__ */
|
|
2
2
|
return n("div",{role:"separator",children:/* @__PURE__ */n(e,{})},d.key);if("label"===d.type)/* @__PURE__ */
|
|
3
3
|
return n("div",{id:`${y}-label-${k}`,children:/* @__PURE__ */n(l,{children:d.label})},d.key);if("status"===d.type)/* @__PURE__ */
|
|
4
4
|
return n("div",{id:c(y,k),className:"text-xs",style:t(),children:d.label},d.key);if("submenu"===d.type)/* @__PURE__ */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Icon as e}from"./chunk-
|
|
1
|
+
import{Icon as e}from"./chunk-MRFNJZRR.js";import{useShellStrings as r}from"./chunk-43MCNASD.js";import{jsxs as t,jsx as n}from"react/jsx-runtime";var s={success:"success",error:"error",warning:"warning",info:"info",404:"info",403:"warning",500:"error"},c={success:"text-green-600 bg-green-100",error:"text-red-600 bg-red-100",warning:"text-amber-600 bg-amber-100",info:"text-blue-600 bg-blue-100"},a={404:e=>e.notFound,403:e=>e.noAccess,500:e=>e.serverError};function i({tone:r}){const t={className:"h-6 w-6",strokeWidth:1.5,"aria-hidden":!0};switch(r){case"success":/* @__PURE__ */
|
|
2
2
|
return n(e,{name:"check",...t});case"error":/* @__PURE__ */
|
|
3
3
|
return n(e,{name:"close",...t});case"warning":/* @__PURE__ */
|
|
4
4
|
return n(e,{name:"error",...t});default:/* @__PURE__ */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useShellLocale as e}from"./chunk-
|
|
1
|
+
import{useShellLocale as e}from"./chunk-43MCNASD.js";import{formatPlain as t}from"./chunk-C3QOHMR6.js";import{jsx as r,jsxs as n}from"react/jsx-runtime";var i={danger:"bg-red-600 text-white",neutral:"bg-gray-600 text-white",accent:"bg-blue-600 text-white"};function a({count:a=0,max:l=99,dot:s=!1,tone:o="danger",showZero:c=!1,children:m,className:u=""}){const h=s||a>0||0===a&&c,d=e(),x=a>l?`${t(l,d)}+`:t(a,d),f=m?"":u,g=h?/* @__PURE__ */r("span",s?{className:`block h-2.5 w-2.5 rounded-full ring-2 ring-white ${i[o]} ${f}`.trim(),"aria-hidden":m?"true":void 0}:{className:`flex h-5 min-w-[1.25rem] items-center justify-center whitespace-nowrap rounded-full px-1 text-xs font-semibold tabular-nums ring-2 ring-white ${i[o]} ${f}`.trim(),children:x}):null;return m?/* @__PURE__ */n("span",{className:`relative inline-flex ${u}`.trim(),children:[m,g&&/* @__PURE__ */r("span",{className:"absolute -right-1.5 -top-1.5 flex",children:g})]}):g}export{a as CountBadge};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import{Pagination as e}from"./chunk-
|
|
1
|
+
import{Pagination as e}from"./chunk-7FBAZLBX.js";import{Checkbox_default as t}from"./chunk-CGZBDI6C.js";import{SpinnerRing as r}from"./chunk-R2VKEMZH.js";import{TH_ONE_LINE as o,OneLineLabel as n}from"./chunk-WGLHB6WE.js";import{useBrowserLayoutEffect as l}from"./chunk-D65T4H6J.js";import{useShellStrings as s}from"./chunk-43MCNASD.js";import{useState as i,useRef as a}from"react";import{jsxs as c,Fragment as d,jsx as h}from"react/jsx-runtime";function u(e){const t={};if(!e)return t;for(const[r,o]of Object.entries(e))!r.startsWith("data-")||"string"!=typeof o&&"number"!=typeof o&&"boolean"!=typeof o||(t[r]=o);return t}var m=e=>Array.isArray(e.columns),f=e=>"wide"===e.only?"rosh-dt-only-wide":"stacked"===e.only?"rosh-dt-only-stacked":"",g="rosh-dt-row-link rosh-focus-ring underline-offset-4 hover:underline",p={sm:"px-2 py-2",md:"px-3 py-2"},y={left:"text-left",right:"text-right",center:"text-center"};function b({direction:e}){/* @__PURE__ */
|
|
2
2
|
return c("span",{className:"ml-1 inline-flex flex-col leading-none","aria-hidden":"true",children:[
|
|
3
3
|
/* @__PURE__ */h("svg",{className:"h-2 w-2 "+("asc"===e?"text-gray-700":"text-gray-300"),viewBox:"0 0 8 5",fill:"currentColor",children:/* @__PURE__ */h("path",{d:"M4 0L8 5H0z"})}),
|
|
4
|
-
/* @__PURE__ */h("svg",{className:"h-2 w-2 "+("desc"===e?"text-gray-700":"text-gray-300"),viewBox:"0 0 8 5",fill:"currentColor",children:/* @__PURE__ */h("path",{d:"M4 5L0 0h8z"})})]})}function w(e,t=!1){const r=t?"":" whitespace-nowrap";return e.code?`font-mono${r}`:e.numeric?`tabular-nums${r}`:""}function x({columns:x,data:v,rowKey:k,sort:N=null,onSortChange:C,pagination:j,caption:M,loading:B=!1,bordered
|
|
5
|
-
return h("th",{scope:"col",...
|
|
4
|
+
/* @__PURE__ */h("svg",{className:"h-2 w-2 "+("desc"===e?"text-gray-700":"text-gray-300"),viewBox:"0 0 8 5",fill:"currentColor",children:/* @__PURE__ */h("path",{d:"M4 5L0 0h8z"})})]})}function w(e,t=!1){const r=t?"":" whitespace-nowrap";return e.code?`font-mono${r}`:e.numeric?`tabular-nums${r}`:""}function x({columns:x,data:v,rowKey:k,sort:N=null,onSortChange:C,pagination:j,caption:M,loading:B=!1,bordered:S=!1,size:$="md",minWidth:z,rowClassName:H,onRow:T,rowHref:A,onRowPress:I,linkAs:L,emptyText:D,selection:E,footer:F,virtualized:W,stackOnNarrow:O=!1,stackBelow:P,className:R=""}){const K=s(),Z=D??K.table.empty,G=(e,t)=>"function"==typeof k?k(e,t):String(e[k]),J=O&&!W,V=J?x:x.flatMap(e=>{if(!m(e))return"stacked"===e.only?[]:[e];const t=e.columns.filter(e=>"stacked"!==e.only);return t.length?[{...e,columns:t}]:[]}),X=e=>J?{role:e}:{},q=(e,t)=>(t??("string"==typeof e||"number"==typeof e?String(e):"")).trim()||void 0,[Q,U]=i(0),Y=W?.overscan??6,_=W?e=>{const t=Math.max(0,Math.floor(e.currentTarget.scrollTop/W.rowHeight)-Y);U(e=>e===t?e:t)}:void 0,ee=W?Math.ceil(W.height/W.rowHeight)+2*Y:v.length,te=W?Math.min(Q,Math.max(0,v.length-ee)):0,re=Math.min(v.length,te+ee),oe=W?te*W.rowHeight:0,ne=W?(v.length-re)*W.rowHeight:0,le=a(null),[se,ie]=i(0);l(()=>{if(!W)return;const e=le.current?.offsetHeight??0;ie(t=>t===e?t:e)});const ae=e=>e.sortField??e.key,ce=e=>N&&N.field===ae(e)?N.direction:null,de=V.flatMap(e=>m(e)?e.columns:[e]),he=V.some(m),ue=/* @__PURE__ */new Map;if(J)for(const e of V)if(m(e))for(const t of e.columns)ue.set(t,q(e.title,e.label));const me=e=>{const t=q(e.title,e.label),r=ue.get(e);return t&&r?`${r} · ${t}`:t},fe=new Set(E?.selected??[]),ge=E?v.map((e,t)=>G(e,t)):[],pe=ge.length>0&&ge.every(e=>fe.has(e)),ye=ge.some(e=>fe.has(e)),be=E?36:0,we=de.length+(E?1:0),xe=de.some(e=>"left"===e.fixed),ve=J&&!E&&de.some(e=>e.cardCorner),ke=L??"a",Ne=`${p[$]} ${"sm"===$?"text-xs":"text-sm"}`,Ce=(e,t)=>e.ellipsis?/* @__PURE__ */h("span",{className:"block w-0 min-w-full",children:t}):t,je=(e,t,r,l=0)=>{const s=ce(e),i=y[e.align??(e.numeric?"right":"left")],a="left"===e.fixed,d=!(!e.sortable||!C);/* @__PURE__ */
|
|
5
|
+
return h("th",{scope:"col",...X("columnheader"),rowSpan:r>1?r:void 0,"aria-sort":"asc"===s?"ascending":"desc"===s?"descending":d?"none":void 0,style:{width:e.width,...a?{left:(Be[t]??0)+be}:{},...W?{top:l}:{}},className:[Ne,i,o,"font-semibold uppercase tracking-wide text-gray-500","sm"===$?"text-2xs":"text-xs",a?W?"sticky z-20 bg-gray-50":"sticky z-10 bg-gray-50":W?"sticky z-10 bg-gray-50":"",J&&d?"rosh-dt-sort":"",J?f(e):"",e.headerClassName??""].filter(Boolean).join(" "),children:Ce(e,d?/* @__PURE__ */c("button",{type:"button",onClick:()=>(e=>{if(!C)return;const t=ae(e),r=ce(e),o=e.sortFirst??"asc";C(null===r?{field:t,direction:o}:r===o?{field:t,direction:"asc"===o?"desc":"asc"}:null)})(e),"data-group":J?ue.get(e):void 0,className:`inline-flex max-w-full items-center font-semibold uppercase tracking-wide hover:text-ink ${i}`,children:[
|
|
6
6
|
/* @__PURE__ */h(n,{children:e.title}),
|
|
7
|
-
/* @__PURE__ */h(b,{direction:s})]}):/* @__PURE__ */h(n,{children:e.title}))},e.key)};let Me=0;const Be=de.map(e=>{if("left"!==e.fixed)return null;const t=Me;return Me+=e.width??0,t})
|
|
8
|
-
/* @__PURE__ */c("div",{onScroll:_,style:
|
|
7
|
+
/* @__PURE__ */h(b,{direction:s})]}):/* @__PURE__ */h(n,{children:e.title}))},e.key)};let Me=0;const Be=de.map(e=>{if("left"!==e.fixed)return null;const t=Me;return Me+=e.width??0,t}),Se=/* @__PURE__ */c(d,{children:[
|
|
8
|
+
/* @__PURE__ */c("div",{onScroll:_,style:W?{maxHeight:W.height}:void 0,className:`relative overflow-x-auto ${W?"overflow-y-auto":""} ${S?"rounded-lg border border-gray-200":""}${J?" rosh-dt-scroll":""}`.trim(),children:[B&&
|
|
9
9
|
/* @__PURE__ */c("div",{className:"absolute inset-0 z-20 flex items-start justify-center bg-white/60 pt-8",role:"status","aria-live":"polite",children:[
|
|
10
10
|
/* @__PURE__ */h(r,{className:"h-6 w-6"}),
|
|
11
|
-
/* @__PURE__ */h("span",{className:"sr-only",children:
|
|
12
|
-
/* @__PURE__ */c("table",{...
|
|
13
|
-
/* @__PURE__ */c("thead",{...
|
|
14
|
-
/* @__PURE__ */c("tr",{ref:le,...
|
|
15
|
-
/* @__PURE__ */h("tbody",{...
|
|
16
|
-
return c("tr",{...u(n),...
|
|
17
|
-
return h("td",{...
|
|
18
|
-
return h("td",{...
|
|
19
|
-
/* @__PURE__ */h("span",{className:["rosh-dt-value",w(e,!0)].filter(Boolean).join(" "),children:o}):o},e.key)})]},
|
|
20
|
-
return h("div",
|
|
11
|
+
/* @__PURE__ */h("span",{className:"sr-only",children:K.table.loading})]}),
|
|
12
|
+
/* @__PURE__ */c("table",{...X("table"),className:(J?"rosh-dt-table ":"")+"w-full border-collapse tabular-nums",style:z?{minWidth:z}:void 0,children:[M&&/* @__PURE__ */h("caption",{className:"sr-only",children:M}),
|
|
13
|
+
/* @__PURE__ */c("thead",{...X("rowgroup"),className:J?"rosh-dt-head":void 0,children:[
|
|
14
|
+
/* @__PURE__ */c("tr",{ref:le,...X("row"),className:"border-b border-gray-200 bg-gray-50",children:[E&&/* @__PURE__ */h("th",{scope:"col",...X("columnheader"),rowSpan:he?2:void 0,style:{width:36,...W?{top:0}:{}},className:[Ne,o,xe||W?"sticky z-20 bg-gray-50":"",xe?"left-0":"",J?"rosh-dt-select":""].filter(Boolean).join(" "),children:/* @__PURE__ */h(t,{"aria-label":K.table.selectAll,checked:pe,indeterminate:ye&&!pe,onChange:()=>{if(!E)return;const e=new Set(ge);E.onChange(pe?E.selected.filter(t=>!e.has(t)):[...E.selected,...ge.filter(e=>!fe.has(e))])}})}),V.map((e,t)=>m(e)?/* @__PURE__ */h("th",{scope:"colgroup",...X("columnheader"),colSpan:e.columns.length,style:W?{top:0}:void 0,className:[Ne,"text-center",o,"font-semibold uppercase tracking-wide text-gray-500","sm"===$?"text-2xs":"text-xs","border-b border-gray-200",W?"sticky z-10 bg-gray-50":"",e.headerClassName??""].filter(Boolean).join(" "),children:/* @__PURE__ */h(n,{children:e.title})},e.key??`group-${t}`):je(e,de.indexOf(e),he?2:1))]}),he&&/* @__PURE__ */h("tr",{...X("row"),className:"border-b border-gray-200 bg-gray-50",children:V.flatMap(e=>m(e)?e.columns:[]).map(e=>je(e,de.indexOf(e),1,se))})]}),
|
|
15
|
+
/* @__PURE__ */h("tbody",{...X("rowgroup"),className:J?"rosh-dt-body":void 0,children:0!==v.length||B?/* @__PURE__ */c(d,{children:[oe>0&&/* @__PURE__ */h("tr",{"aria-hidden":"true",children:/* @__PURE__ */h("td",{colSpan:we,style:{height:oe,padding:0,border:0}})}),v.slice(te,re).map((e,r)=>{const o=te+r,n=T?.(e,o),l=!!n?.current,s=A?.(e,o),i=void 0===s&&I?()=>I(e,o):void 0,a=void 0!==s||void 0!==i;let d=!1;const m=(e,t)=>{if(d=!0,!a)return e;const r=[g,i?"cursor-pointer text-left":"",t?.className??""].filter(Boolean).join(" "),o=l?"true":void 0;return void 0!==s?/* @__PURE__ */h(ke,{href:s,className:r,"aria-current":o,children:e}):/* @__PURE__ */h("button",{type:"button",onClick:i,className:r,"aria-current":o,children:e})},p=de.map(t=>t.render?t.render(e,o,m):t.dataIndex?e[t.dataIndex]:null);if(a&&!d){const e=de.findIndex(e=>"stacked"!==e.only&&!e.cardCorner),t=de.findIndex(e=>"wide"!==e.only&&!e.cardCorner);for(const r of/* @__PURE__ */new Set([e,t]))r>=0&&(p[r]=m(p[r]))}const b=e=>e?t=>{t.currentTarget.contains(t.relatedTarget)||e()}:void 0;/* @__PURE__ */
|
|
16
|
+
return c("tr",{...u(n),...X("row"),style:W?{height:W.rowHeight}:void 0,onClick:n?.onClick,onMouseEnter:n?.onMouseEnter,onMouseLeave:n?.onMouseLeave,onFocus:b(n?.onFocus),onBlur:b(n?.onBlur),"aria-current":l&&!a?"true":void 0,...n?.onClick?{tabIndex:0,onKeyDown:e=>{e.target===e.currentTarget&&("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),n.onClick?.()))}}:{},className:[J?E?"rosh-dt-row rosh-dt-row-select":"rosh-dt-row":"",J&&ve?"rosh-dt-row-corner":"","border-b border-gray-100 last:border-b-0",n?.onClick?"cursor-pointer hover:bg-gray-50 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring-solid)]":"",a?"rosh-dt-linked hover:bg-gray-50":"",l?"rosh-dt-current":"",H?.(e,o)??"",n?.className??""].filter(Boolean).join(" "),children:[E&&(()=>{const r=G(e,o);/* @__PURE__ */
|
|
17
|
+
return h("td",{...X("cell"),style:{width:36},onClick:e=>e.stopPropagation(),className:[Ne,xe?"sticky left-0 z-10 bg-white":"",J?"rosh-dt-select":""].filter(Boolean).join(" "),children:/* @__PURE__ */h(t,{"aria-label":K.table.selectRow,checked:fe.has(r),onChange:()=>(e=>{E&&E.onChange(fe.has(e)?E.selected.filter(t=>t!==e):[...E.selected,e])})(r)})})})(),de.map((e,t)=>{const r="left"===e.fixed,o=p[t],n=ve&&!!e.cardCorner,l=J&&!n&&"wide"!==e.only;/* @__PURE__ */
|
|
18
|
+
return h("td",{...X("cell"),"data-label":l?me(e):void 0,style:r?{left:(Be[t]??0)+be}:void 0,className:[l?e.ellipsis?"rosh-dt-cell rosh-dt-clip":"rosh-dt-cell":"",n?"rosh-dt-corner":"",J?f(e):"",Ne,y[e.align??(e.numeric?"right":"left")],J?"":w(e),"text-ink-strongest",e.ellipsis?"max-w-0 truncate":"",r?"sticky z-10 bg-white":"",e.className??""].filter(Boolean).join(" "),children:J?
|
|
19
|
+
/* @__PURE__ */h("span",{className:["rosh-dt-value",w(e,!0)].filter(Boolean).join(" "),children:o}):o},e.key)})]},G(e,o))}),ne>0&&/* @__PURE__ */h("tr",{"aria-hidden":"true",children:/* @__PURE__ */h("td",{colSpan:we,style:{height:ne,padding:0,border:0}})})]}):/* @__PURE__ */h("tr",{...X("row"),className:J?"rosh-dt-empty":void 0,children:/* @__PURE__ */h("td",{...X("cell"),colSpan:we,className:`${Ne} py-10 text-center text-gray-500`,children:Z})})})]}),F]}),j&&j.pageCount>1&&/* @__PURE__ */h("div",{className:J?"rosh-dt-pager mt-3 flex justify-end":"mt-3 flex justify-end",children:/* @__PURE__ */h(e,{page:j.page,pageCount:j.pageCount,onPageChange:j.onPageChange})})]});/* @__PURE__ */
|
|
20
|
+
return h("div",J?void 0!==P&&P>0&&40!==P?{className:`rosh-dt-at ${R}`.trim(),children:/* @__PURE__ */h("div",{className:"rosh-dt-stack",style:{width:40/P*100+"%"},children:/* @__PURE__ */h("div",{className:"rosh-dt-fit",style:{width:P/40*100+"%"},children:Se})})}:{className:`rosh-dt-stack ${R}`.trim(),children:Se}:{className:R,children:Se})}export{x as DataTable};
|