efficient-shell 10.16.0 → 10.17.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/dist/{Browser-RI5X7GMK.js → Browser-Q5BYSSW3.js} +14 -14
- package/dist/Calculator-6NJNSIRN.js +29 -0
- package/dist/{CurrencyConverter-2GUEE7ZR.js → CurrencyConverter-42IHLJVV.js} +8 -8
- package/dist/{Documents-GI346UL5.js → Documents-GGEPMWB5.js} +21 -21
- package/dist/Files-OVNXUYOV.js +88 -0
- package/dist/{Notepad-HRZKLHO3.js → Notepad-L2LOWTSE.js} +10 -10
- package/dist/{PdfViewer-LU5JKHSG.js → PdfViewer-Y3SAVADX.js} +1 -1
- package/dist/{PomodoroTimer-QYCTTTPZ.js → PomodoroTimer-PD7POYX5.js} +68 -68
- package/dist/{Preview-LSGN5GN7.js → Preview-HM2Z3EJO.js} +25 -25
- package/dist/Sidebar-2HHICMZZ.js +44 -0
- package/dist/{Spreadsheet-7JBZY6KJ.js → Spreadsheet-2E4TQ64O.js} +13 -13
- package/dist/{Stock-ZVQT25IE.js → Stock-IABQRSXZ.js} +3 -3
- package/dist/{Weather-RAUDLLVU.js → Weather-4QPYOENN.js} +22 -22
- package/dist/{WorldClock-2XBWZ6SZ.js → WorldClock-3ZVRBLEW.js} +6 -6
- package/dist/ai/index.d.ts +1 -1
- package/dist/ai/index.js +80 -80
- package/dist/apps/index.js +1 -1
- package/dist/bin/media-host-check.js +1 -1
- package/dist/bin/ui-check.js +1 -1
- package/dist/charts/BoxPlotChart.js +1 -1
- package/dist/charts/CandlestickChart.js +1 -1
- package/dist/charts/CartesianPlot.js +1 -1
- package/dist/charts/ChartBrush.js +1 -1
- package/dist/charts/ChartFrame.js +1 -1
- package/dist/charts/ChartSkeleton.js +1 -1
- package/dist/charts/ChordChart.js +1 -1
- package/dist/charts/ColumnChart.js +1 -1
- package/dist/charts/FunnelChart.js +1 -1
- package/dist/charts/HeatmapChart.js +1 -1
- package/dist/charts/HistogramChart.js +1 -1
- package/dist/charts/Meter.js +1 -1
- package/dist/charts/PieChart.js +1 -1
- package/dist/charts/RadarChart.js +1 -1
- package/dist/charts/RadialBarChart.js +1 -1
- package/dist/charts/RangeChart.js +1 -1
- package/dist/charts/RankedBars.js +1 -1
- package/dist/charts/SankeyChart.js +1 -1
- package/dist/charts/ScatterChart.js +1 -1
- package/dist/charts/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-W6URVLQF.js → chunk-22RQC4EW.js} +14 -14
- package/dist/chunk-26RTJKHD.js +2 -0
- package/dist/{chunk-F2R3UFNQ.js → chunk-2E2SUEEE.js} +1 -1
- package/dist/chunk-2H6YNMBE.js +14 -0
- package/dist/{chunk-7HTRLRVO.js → chunk-2YSGXZOL.js} +50 -50
- package/dist/{chunk-M22B3Y5Y.js → chunk-3IUPYCW3.js} +1 -1
- package/dist/{chunk-JGTGQGHY.js → chunk-3PR5YMWZ.js} +1 -1
- package/dist/{chunk-MNSKGMVZ.js → chunk-3UXXA2CS.js} +8 -8
- package/dist/{chunk-XDBG4HPV.js → chunk-4EZIWLJJ.js} +1 -1
- package/dist/{chunk-E3753CWP.js → chunk-4HBSQGRI.js} +1 -1
- package/dist/{chunk-EZEYKCI6.js → chunk-4ULRP4Y4.js} +1 -1
- package/dist/{chunk-LDE5IV2M.js → chunk-54NMFQMW.js} +4 -4
- package/dist/{chunk-DRDYZ633.js → chunk-5QGBVTGS.js} +2 -2
- package/dist/{chunk-57HN6MPC.js → chunk-5SIOCKCK.js} +2 -2
- package/dist/{chunk-ISJPW2FZ.js → chunk-5TDQPZDB.js} +10 -10
- package/dist/chunk-5TQLUPZD.js +6 -0
- package/dist/{chunk-D7F442OZ.js → chunk-5WYRAJ5F.js} +1 -1
- package/dist/chunk-67MQ5S32.js +8 -0
- package/dist/chunk-6JSXIEH2.js +4 -0
- package/dist/{chunk-ULXCDM7Y.js → chunk-6V4INP7J.js} +10 -10
- package/dist/{chunk-7NBSBGLX.js → chunk-77AQNJE2.js} +8 -8
- package/dist/{chunk-Y3R267FV.js → chunk-77MOYIQW.js} +10 -10
- package/dist/{chunk-AKM6JBMD.js → chunk-7ELJQL7J.js} +1 -1
- package/dist/chunk-7INZ7O3A.js +5 -0
- package/dist/{chunk-UPQW4GCT.js → chunk-7TZV6G2F.js} +1 -1
- package/dist/{chunk-X6BFVDB4.js → chunk-7VBXIIEC.js} +2 -2
- package/dist/{chunk-UWIZX3RK.js → chunk-A42MKJA3.js} +1 -1
- package/dist/{chunk-DKGZPVLL.js → chunk-AFYLVV74.js} +1 -1
- package/dist/{chunk-H4HB5OET.js → chunk-AWKJZSTO.js} +1 -1
- package/dist/{chunk-H32EQG5Z.js → chunk-AYDW63LV.js} +9 -9
- package/dist/chunk-B23RG53S.js +14 -0
- package/dist/chunk-B3CN55UI.js +2 -0
- package/dist/{chunk-CPZ42W2B.js → chunk-C6Y7B73Q.js} +1 -1
- package/dist/{chunk-QP4UPCXQ.js → chunk-C764JODK.js} +1 -1
- package/dist/{chunk-LEDUD23S.js → chunk-CLTRQ7AQ.js} +1 -1
- package/dist/chunk-CUHUZBFH.js +29 -0
- package/dist/chunk-CXYHFGUY.js +9 -0
- package/dist/{chunk-TM33D3CE.js → chunk-DCRLJMQ6.js} +1 -1
- package/dist/{chunk-AOK3BHRT.js → chunk-DGZAQXTW.js} +4 -4
- package/dist/{chunk-UYRITNQW.js → chunk-DHIQ46C5.js} +1 -1
- package/dist/{chunk-IOJNSX4N.js → chunk-DQQKG46I.js} +7 -7
- package/dist/chunk-DYNJ2H6R.js +8 -0
- package/dist/{chunk-INNIWRVU.js → chunk-E6GDAV5R.js} +2 -2
- package/dist/{chunk-N3TOHWFF.js → chunk-ECJKIPWU.js} +1 -1
- package/dist/chunk-EJUNGVK2.js +22 -0
- package/dist/{chunk-3EJ64VKE.js → chunk-EN5NXWT6.js} +1 -1
- package/dist/{chunk-MCDM2G4W.js → chunk-EOWUUOVE.js} +1 -1
- package/dist/{chunk-7TNAOZZ2.js → chunk-EPY34L26.js} +1 -1
- package/dist/{chunk-PVZGSCCB.js → chunk-FACWYKL6.js} +6 -6
- package/dist/{chunk-6AS5PHHK.js → chunk-FKRPQDFX.js} +17 -17
- package/dist/{chunk-QHOBK35Y.js → chunk-FOFZI62F.js} +1 -1
- package/dist/{chunk-7ZP64SC7.js → chunk-FS6EOU4G.js} +1 -1
- package/dist/chunk-GDQJBQ5B.js +1 -0
- package/dist/{chunk-YOSUCCHG.js → chunk-GEP4FROW.js} +3 -3
- package/dist/chunk-HJCUDXLV.js +1 -0
- package/dist/{chunk-S6FBMSFU.js → chunk-HJW67KA7.js} +2 -2
- package/dist/{chunk-7X5FABQS.js → chunk-HV47GP2C.js} +1 -1
- package/dist/{chunk-74OUAR6L.js → chunk-I33SVQ7P.js} +6 -6
- package/dist/{chunk-KJ4CBZEQ.js → chunk-IMDGMUE3.js} +1 -1
- package/dist/{chunk-HNBGLF4B.js → chunk-JFV5CQN4.js} +1 -1
- package/dist/{chunk-7MSC3Z5H.js → chunk-JH4ZCPHW.js} +8 -8
- package/dist/chunk-JIGFR7Z3.js +11 -0
- package/dist/chunk-JNQKBN5M.js +7 -0
- package/dist/{chunk-OOLPDASG.js → chunk-JSG2AKCG.js} +1 -1
- package/dist/{chunk-6RX4PVBU.js → chunk-JTMEFXRL.js} +1 -1
- package/dist/{chunk-4QJOEHM6.js → chunk-JYIH2EBG.js} +1 -1
- package/dist/chunk-K4JQ3FQI.js +2 -0
- package/dist/{chunk-ULAGXDOL.js → chunk-LXL2UCUR.js} +1 -1
- package/dist/{chunk-I2XGPTCN.js → chunk-LYHJHUQH.js} +1 -1
- package/dist/{chunk-JSGQWVYH.js → chunk-MJGK6QTO.js} +7 -7
- package/dist/{chunk-PYAJCN2Q.js → chunk-MNNZGO2E.js} +1 -1
- package/dist/{chunk-XTCXX5LJ.js → chunk-MS5APD3V.js} +1 -1
- package/dist/chunk-MUXGWDEH.js +2 -0
- package/dist/{chunk-PCFBDXLN.js → chunk-N6CS2FO2.js} +1 -1
- package/dist/{chunk-2SY76NFO.js → chunk-NFB7PARJ.js} +4 -4
- package/dist/{chunk-K4ANB6AF.js → chunk-NNZFC4O7.js} +1 -1
- package/dist/{chunk-MHB52H2Y.js → chunk-NU5HN3FZ.js} +12 -12
- package/dist/{chunk-QYSEYYV7.js → chunk-NVD4AI5Y.js} +1 -1
- package/dist/{chunk-AJO72CPB.js → chunk-O47HKK6E.js} +2 -2
- package/dist/{chunk-BJXDOM2N.js → chunk-OBJGUJIE.js} +1 -1
- package/dist/{chunk-AUWTGM65.js → chunk-OH5L6HYW.js} +3 -3
- package/dist/{chunk-WINNA7LS.js → chunk-OORL6BIG.js} +1 -1
- package/dist/{chunk-KTA77U3P.js → chunk-OP5DOO3K.js} +4 -4
- package/dist/{chunk-ZURB2DCM.js → chunk-OPN4I565.js} +1 -1
- package/dist/{chunk-7SMV6G4Z.js → chunk-ORIXCEKO.js} +1 -1
- package/dist/{chunk-TOVKWNI2.js → chunk-P3RXXWXN.js} +6 -6
- package/dist/{chunk-ON67HF5K.js → chunk-PCTOL2FX.js} +8 -8
- package/dist/{chunk-XZGGJHJC.js → chunk-PLK2WHZG.js} +17 -17
- package/dist/{chunk-QDQ347RL.js → chunk-PW52RXPI.js} +1 -1
- package/dist/chunk-QDKAA3HR.js +2 -0
- package/dist/chunk-QHPVAXHR.js +6 -0
- package/dist/chunk-QO5E33DH.js +8 -0
- package/dist/{chunk-7HLC352T.js → chunk-QRYSL6QU.js} +16 -16
- package/dist/{chunk-LPXMHYTM.js → chunk-QVZKRROQ.js} +1 -1
- package/dist/{chunk-EXJXOKUU.js → chunk-QYL26AB4.js} +1 -1
- package/dist/{chunk-SDQIXE5M.js → chunk-RBBIAIPH.js} +8 -8
- package/dist/{chunk-TVH7IZQ4.js → chunk-REWKL7MX.js} +2 -2
- package/dist/{chunk-L4IW77TD.js → chunk-RT4WOEVS.js} +4 -4
- package/dist/{chunk-SG4LO2AN.js → chunk-RUGQO7YF.js} +11 -11
- package/dist/{chunk-MTEFYFUO.js → chunk-RVRDDTEG.js} +1 -1
- package/dist/{chunk-D4I3U7UE.js → chunk-RXCGE2AY.js} +1 -1
- package/dist/{chunk-UDRMZ22J.js → chunk-S74LKSUB.js} +1 -1
- package/dist/{chunk-QYRMFGES.js → chunk-SAP4YI2Y.js} +1 -1
- package/dist/{chunk-CKKUFDZ3.js → chunk-SDDV3UCN.js} +18 -18
- package/dist/{chunk-KEPJWZJZ.js → chunk-SL77N7VT.js} +3 -3
- package/dist/chunk-SLU45G5J.js +19 -0
- package/dist/{chunk-5RE6R3XC.js → chunk-SXNQHIBY.js} +1 -1
- package/dist/{chunk-GGK27H67.js → chunk-TGGUYAWA.js} +1 -1
- package/dist/chunk-TGXO3CDO.js +2 -0
- package/dist/chunk-TLMFVEMC.js +9 -0
- package/dist/{chunk-MQU3PZUS.js → chunk-TMMNCXQT.js} +1 -1
- package/dist/{chunk-CQV3VSI2.js → chunk-UDKTAG57.js} +1 -1
- package/dist/{chunk-UTWJKSET.js → chunk-UEISJFZH.js} +5 -5
- package/dist/{chunk-CBEKJTXU.js → chunk-UYRMW5MO.js} +5 -5
- package/dist/{chunk-RLJHRDDW.js → chunk-V6Y4OC6K.js} +8 -8
- package/dist/{chunk-W5CJD54C.js → chunk-VAK5FQXH.js} +1 -1
- package/dist/{chunk-WB4P4QE2.js → chunk-VDUXPMOQ.js} +1 -1
- package/dist/{chunk-O7DW2BKY.js → chunk-VHF3CJVO.js} +28 -28
- package/dist/{chunk-KTVXPGGB.js → chunk-VIQ6OME2.js} +8 -8
- package/dist/{chunk-7UTPXU6K.js → chunk-VN4KSRZ5.js} +1 -1
- package/dist/{chunk-RPYFOQM2.js → chunk-VQCSHJEF.js} +2 -2
- package/dist/chunk-VWIYC2NB.js +13 -0
- package/dist/chunk-WRQ4A5QY.js +1 -0
- package/dist/{chunk-3LDXURVU.js → chunk-WTYQF7XJ.js} +2 -2
- package/dist/{chunk-GPJO34QP.js → chunk-WYFMSL4Q.js} +8 -8
- package/dist/{chunk-FEQDZTZ7.js → chunk-XCHAU2UN.js} +6 -6
- package/dist/chunk-XGJQVIEG.js +2 -0
- package/dist/{chunk-VTFZ6W2D.js → chunk-XLWMM53L.js} +1 -1
- package/dist/{chunk-VKKK4WLS.js → chunk-XQZL6JDD.js} +6 -6
- package/dist/{chunk-JEH5EVIG.js → chunk-XSJHN2GD.js} +1 -1
- package/dist/{chunk-BNJWZAQE.js → chunk-XYBI57KO.js} +12 -12
- package/dist/{chunk-3AH524CN.js → chunk-XYECIBVX.js} +1 -1
- package/dist/{chunk-LO5T2K4B.js → chunk-Y62TTKSY.js} +3 -3
- package/dist/{chunk-6C6TRDNI.js → chunk-YG2TWBDH.js} +1 -1
- package/dist/{chunk-SHKBDFSE.js → chunk-YILGAEW3.js} +1 -1
- package/dist/chunk-YJ5IHIAI.js +2 -0
- package/dist/{chunk-FWVC4A2O.js → chunk-YJXS7BR5.js} +1 -1
- package/dist/{chunk-NBVHJZVS.js → chunk-YQFGRYEF.js} +12 -12
- package/dist/{chunk-4G2C6J4I.js → chunk-YSDPFDAG.js} +1 -1
- package/dist/{chunk-B7UCXROE.js → chunk-Z5A4EY2R.js} +1 -1
- package/dist/{chunk-ZW3IDCP2.js → chunk-ZGOHRLXG.js} +1 -1
- package/dist/{chunk-5UYZ75F3.js → chunk-ZHAWOZA7.js} +11 -11
- package/dist/{chunk-IKNG7EFQ.js → chunk-ZQKA2XKH.js} +8 -8
- package/dist/data/DataTable.js +1 -1
- package/dist/data/Kanban.js +1 -1
- package/dist/data/ListFooter.js +1 -1
- package/dist/data/ListLoadError.js +1 -1
- package/dist/data/Pagination.js +1 -1
- package/dist/file-intake/index.js +1 -1
- package/dist/forms/BorderInput.js +1 -1
- package/dist/forms/BrandAssetEditor.js +1 -1
- package/dist/forms/Calendar.js +1 -1
- package/dist/forms/ColorPicker.js +1 -1
- package/dist/forms/ComposerAttachments.js +1 -1
- package/dist/forms/CornersInput.js +1 -1
- package/dist/forms/DatePicker.js +1 -1
- package/dist/forms/DateRangePicker.js +1 -1
- package/dist/forms/DateTimePicker.js +1 -1
- package/dist/forms/DisplayChips.js +1 -1
- package/dist/forms/FilePicker.js +1 -1
- package/dist/forms/FormErrorSummary.js +1 -1
- package/dist/forms/IconPicker.js +1 -1
- package/dist/forms/ImageFocusPoint.js +1 -1
- package/dist/forms/InputNumber.js +1 -1
- package/dist/forms/LinkPicker.js +1 -1
- package/dist/forms/MediaLibrary.js +1 -1
- package/dist/forms/MediaUploadField.js +1 -1
- package/dist/forms/MediaUploadGrid.js +1 -1
- package/dist/forms/MediaUsedInList.js +1 -1
- package/dist/forms/NumericKeypad.js +1 -1
- package/dist/forms/PositionInput.js +1 -1
- package/dist/forms/Select.d.ts +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/TagInput.js +1 -1
- package/dist/forms/TextToolbar.d.ts +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.d.ts +1 -1
- package/dist/forms/textAlign.js +1 -1
- package/dist/forms/useFileIntake.js +1 -1
- package/dist/hooks/useTheme.d.ts +1 -1
- package/dist/icons/efficient-glyphs.d.ts +2 -0
- package/dist/icons/efficient-glyphs.js +1 -1
- package/dist/icons/efficient-looks.d.ts +4 -0
- package/dist/icons/efficient-looks.js +1 -1
- package/dist/icons/efficient-meanings.d.ts +2 -0
- package/dist/icons/efficient-meanings.js +1 -1
- package/dist/icons/efficient.d.ts +2 -0
- package/dist/icons/efficient.js +1 -1
- package/dist/icons/glyphs/SeparatorSlashIcon.d.ts +8 -0
- package/dist/icons/glyphs/SeparatorSlashIcon.js +1 -0
- package/dist/icons/glyphs/SeparatorTriangleIcon.d.ts +8 -0
- package/dist/icons/glyphs/SeparatorTriangleIcon.js +1 -0
- package/dist/icons/index.d.ts +2 -2
- package/dist/icons/index.js +1 -1
- package/dist/icons/looks/SeparatorSlashMiniIcon.d.ts +8 -0
- package/dist/icons/looks/SeparatorSlashMiniIcon.js +1 -0
- package/dist/icons/looks/SeparatorSlashSolidIcon.d.ts +8 -0
- package/dist/icons/looks/SeparatorSlashSolidIcon.js +1 -0
- package/dist/icons/looks/SeparatorTriangleMiniIcon.d.ts +8 -0
- package/dist/icons/looks/SeparatorTriangleMiniIcon.js +1 -0
- package/dist/icons/looks/SeparatorTriangleSolidIcon.d.ts +8 -0
- package/dist/icons/looks/SeparatorTriangleSolidIcon.js +1 -0
- package/dist/icons/looks/map.js +1 -1
- package/dist/icons/sets.js +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +172 -172
- package/dist/locales/zh-Hans.js +1 -1
- package/dist/map/index.js +7 -7
- package/dist/{names-Bmx_9y41.d.ts → names-CkQuQ47O.d.ts} +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/CountBadge.js +1 -1
- package/dist/shell/Dialog.js +1 -1
- package/dist/shell/Drawer.js +1 -1
- package/dist/shell/EditableGrid.js +1 -1
- package/dist/shell/EmptyState.js +1 -1
- package/dist/shell/GlobalSearch.js +1 -1
- package/dist/shell/HelpCenter.js +1 -1
- package/dist/shell/IconRail.js +1 -1
- package/dist/shell/ImageLightbox.js +1 -1
- package/dist/shell/ItemCount.js +1 -1
- package/dist/shell/LanguageSelect.js +1 -1
- package/dist/shell/Markdown.d.ts +1 -1
- package/dist/shell/Markdown.js +1 -1
- package/dist/shell/MetricBar.js +1 -1
- package/dist/shell/MetricBarLegend.js +1 -1
- package/dist/shell/MilestoneTimeline.js +1 -1
- package/dist/shell/PageHeader.js +1 -1
- package/dist/shell/ProductionTimeline.js +1 -1
- package/dist/shell/ResizeHandle.js +1 -1
- package/dist/shell/Result.js +1 -1
- package/dist/shell/SearchableSelect.js +1 -1
- package/dist/shell/SettingReset.js +1 -1
- package/dist/shell/SettingRow.js +1 -1
- package/dist/shell/SidebarLayout.js +1 -1
- package/dist/shell/SidebarNav.js +1 -1
- package/dist/shell/SortableList.js +1 -1
- package/dist/shell/Statistic.js +1 -1
- package/dist/shell/TimeAgo.js +1 -1
- package/dist/shell/TimelineTrack.js +1 -1
- package/dist/shell/TransferProgress.js +1 -1
- package/dist/shell/Tree.js +1 -1
- package/dist/shell/discardGuard.js +1 -1
- package/dist/shell/language.js +1 -1
- package/dist/shell/strings.d.ts +6 -0
- package/dist/shell/strings.js +1 -1
- package/dist/shell/toast.js +1 -1
- package/dist/telemetry/index.js +1 -1
- package/dist/templates/AuthScreen.js +1 -1
- package/dist/templates/ChatTemplate.js +1 -1
- package/dist/templates/CheckoutTemplate.js +1 -1
- package/dist/templates/DashboardTemplate.js +1 -1
- package/dist/templates/DataTablePage.js +1 -1
- package/dist/templates/EmailTemplate.js +1 -1
- package/dist/templates/ErrorBoundary.d.ts +1 -1
- package/dist/templates/ErrorBoundary.js +1 -1
- package/dist/templates/ErrorPage.js +1 -1
- package/dist/templates/FormLayoutPage.js +1 -1
- package/dist/templates/GalleryTemplate.js +1 -1
- package/dist/ui/index.d.ts +1 -1
- package/dist/ui/index.js +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/Calculator-Y566OMJZ.js +0 -29
- package/dist/Files-UA23KXN7.js +0 -88
- package/dist/Sidebar-2P26444H.js +0 -44
- package/dist/chunk-2JG5JU4M.js +0 -8
- package/dist/chunk-4PAWQEXM.js +0 -1
- package/dist/chunk-7XYTJPWW.js +0 -29
- package/dist/chunk-COJYPNKF.js +0 -2
- package/dist/chunk-DWR7MYQU.js +0 -7
- package/dist/chunk-EU3JZGV2.js +0 -14
- package/dist/chunk-JJW43QPS.js +0 -9
- package/dist/chunk-LCJRTJXT.js +0 -13
- package/dist/chunk-LU6NA4RU.js +0 -5
- package/dist/chunk-M4K6FLIY.js +0 -1
- package/dist/chunk-PJQGYKN6.js +0 -11
- package/dist/chunk-PN65IIYN.js +0 -8
- package/dist/chunk-Q6YNMNUH.js +0 -6
- package/dist/chunk-RCPFUDPS.js +0 -4
- package/dist/chunk-RRUHQLUY.js +0 -14
- package/dist/chunk-TMNAHOJ7.js +0 -9
- package/dist/chunk-UBMY23AG.js +0 -6
- package/dist/chunk-VNACNNCJ.js +0 -19
- package/dist/chunk-W35N7SL3.js +0 -8
- package/dist/chunk-W4OBVKN4.js +0 -1
- package/dist/chunk-WMEYNKXZ.js +0 -22
- package/dist/chunk-ZZVE64OI.js +0 -2
- /package/dist/{chunk-6V6ANLHW.js → chunk-Y2AGVGOP.js} +0 -0
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{useOverlayTarget as e,usePopupAnchor as r,usePanelPosition as i,OverlayLayerProvider as t}from"./chunk-3DVNXNTF.js";import{useDiscardGuard as l}from"./chunk-ECJKIPWU.js";import{dialogA11y as a}from"./chunk-VWGWZY7A.js";import{useDismissPopupsOnOpen as o}from"./chunk-7QSDPSXP.js";import{useFocusTrap as n,useScrollLock as s}from"./chunk-CDAJKLGL.js";import{Icon as d}from"./chunk-2UO47XB4.js";import{Z_LAYERS as c}from"./chunk-62LW225J.js";import{useHydrated as m}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as u}from"./chunk-TWVUQUUD.js";import{useShellStrings as p}from"./chunk-GDQJBQ5B.js";import{useRef as f,useId as h,useState as x,useEffect as v}from"react";import{createPortal as b}from"react-dom";import{jsxs as y,Fragment as g,jsx as k}from"react/jsx-runtime";var j={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-4xl","2xl":"max-w-6xl"};function N({open:N,onClose:w,title:C,description:D,role:W="dialog",children:J,footer:U,blocking:B=!1,size:L="md",aside:Q=!1,dirty:T=!1,initialFocus:G,"aria-label":I,"aria-labelledby":P,"aria-describedby":V,className:X=""}){const $=f(null),z=h(),A=h(),F=!B,K=h(),S=p().dialog,E=e(m()),[H,O]=x(null),Y=l({open:N,dirty:T,onClose:w,title:C,layer:H}),Z=f(null),q=r(N&&null!==E,Z),M=i(q,$);if(o(N),n($,N&&null!==E,G),s(N),v(()=>{if(N)return u(()=>(B||Y(),!0),()=>$.current)},[N,B,Y]),!N||!E)return null;/* @__PURE__ */
|
|
2
|
+
return y(g,{children:[/* @__PURE__ */k("span",{ref:Z,hidden:!0,"data-popup-anchor":""}),b(
|
|
3
|
+
/* @__PURE__ */k(t,{value:H,children:/* @__PURE__ */y("div",{ref:O,className:"fixed inset-0"+(Q?" pointer-events-none opacity-0":""),style:{zIndex:c.overlay},role:"presentation","data-overlay-layer":"","data-aside":Q?"":void 0,children:[
|
|
4
|
+
/* @__PURE__ */k("div",{className:"fixed inset-0 bg-black/30","aria-hidden":"true"}),
|
|
5
|
+
/* @__PURE__ */k("div",{className:q?"fixed inset-0":"fixed inset-0 flex items-center justify-center p-4",onClick:B?void 0:e=>{e.target===e.currentTarget&&Y()},children:/* @__PURE__ */y("div",{ref:$,"data-popup-panel":"",style:q?{left:M?.left??0,top:M?.top??0,visibility:M?void 0:"hidden"}:void 0,...a({role:W,modal:!0,titleId:C?K:void 0,labelledBy:P,label:I}),"aria-describedby":V??(D?A:J?z:void 0),className:`${q?"absolute max-h-[calc(100%-2rem)] w-[calc(100%-2rem)]":"relative max-h-full w-full"} ${j[L]} overflow-y-auto overscroll-contain rounded-(--radius-card) bg-white p-6 shadow-xl ${X}`.trim(),children:[C&&/* @__PURE__ */k("h2",{id:K,className:(F?"pr-8 ":"")+"text-base font-semibold text-gray-900",children:C}),D&&/* @__PURE__ */k("p",{id:A,className:((C?"mt-1":F?"pr-8":"")+" text-sm text-gray-500").trim(),children:D}),J&&/* @__PURE__ */k("div",{id:z,className:"mt-2 text-sm text-gray-600",children:J}),U&&/* @__PURE__ */k("div",{className:"mt-6 flex flex-wrap justify-end gap-3",children:U}),F&&/* @__PURE__ */k("button",{type:"button",onClick:Y,"aria-label":S.close,className:"absolute right-3 top-3 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__ */k(d,{name:"close",className:"h-5 w-5",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})})]})})]})}),E)]})}export{N as Dialog};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{ShellStringsProvider as t}from"./chunk-
|
|
1
|
+
import{ShellStringsProvider as t}from"./chunk-GDQJBQ5B.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,5 +1,5 @@
|
|
|
1
|
-
import{Icon as e}from"./chunk-2UO47XB4.js";import{Tooltip as t}from"./chunk-6XBWM453.js";import{useShellStrings as n}from"./chunk-
|
|
1
|
+
import{Icon as e}from"./chunk-2UO47XB4.js";import{Tooltip as t}from"./chunk-6XBWM453.js";import{useShellStrings as n}from"./chunk-GDQJBQ5B.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,y=i(),N=["es-default-reset"];if(c&&N.push("is-changed"),k&&N.push(k),!c&&h)return N.push("is-pressable"),/* @__PURE__ */a(t,{content:h.title,children:/* @__PURE__ */a("button",{type:"button",className:N.join(" "),"aria-label":h.title,disabled:f,onClick:h.onPress,children:h.icon})});if(!c)/* @__PURE__ */return a("span",{className:N.join(" "),"aria-hidden":"true"});const x="desktop"===u,g=p??(x?j.resetName(o):j.inheritName(o)),B=b?j.backTo(b):x?j.backToDefault:j.backToAuto,T=m??(b?j.tip(g,B):g);
|
|
2
2
|
/* @__PURE__ */
|
|
3
3
|
return r(t,{content:T,describe:!1,children:[
|
|
4
4
|
/* @__PURE__ */a("button",{type:"button",className:N.join(" "),"aria-label":g,"aria-describedby":y,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"})}),
|
|
5
|
-
/* @__PURE__ */a("span",{id:y,hidden:!0,children:
|
|
5
|
+
/* @__PURE__ */a("span",{id:y,hidden:!0,children:B})]})}export{o as SettingReset};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{appendKey as r,backspace as a}from"./chunk-VEPVOHCV.js";import{Button_default as e}from"./chunk-I4VIEGCX.js";import{useShellStrings as n}from"./chunk-
|
|
1
|
+
import{appendKey as r,backspace as a}from"./chunk-VEPVOHCV.js";import{Button_default as e}from"./chunk-I4VIEGCX.js";import{useShellStrings as n}from"./chunk-GDQJBQ5B.js";import{jsxs as i,jsx as c}from"react/jsx-runtime";var o=["1","2","3","4","5","6","7","8","9",".","0"];function l({value:l,onChange:s,onEnter:t,enterLabel:m,enterDisabled:d,className:h=""}){const p=n().keypad,u=r=>{r!==l&&s(r)};/* @__PURE__ */
|
|
2
2
|
return i("div",{className:`grid grid-cols-3 gap-3 ${h}`.trim(),children:[o.map(a=>/* @__PURE__ */c(e,{size:"touch-xl",variant:"secondary",onClick:()=>u(r(l,a)),children:a},a)),
|
|
3
3
|
/* @__PURE__ */c(e,{size:"touch-xl",variant:"secondary","aria-label":p.backspace,onClick:()=>u(a(l)),children:"⌫"}),t&&/* @__PURE__ */c(e,{size:"touch-xl",variant:"primary",className:"col-span-3",disabled:d,onClick:t,children:m??p.enter})]})}export{l as NumericKeypad};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{useShellLocale as e}from"./chunk-
|
|
1
|
+
import{useShellLocale as e}from"./chunk-GDQJBQ5B.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,4 +1,4 @@
|
|
|
1
|
-
import{useShellStrings as e,useShellLocale as a}from"./chunk-
|
|
1
|
+
import{useShellStrings as e,useShellLocale as a}from"./chunk-GDQJBQ5B.js";import{formatPlain as n}from"./chunk-C3QOHMR6.js";import{useState as i,useId as d}from"react";import{jsx as r,jsxs as c,Fragment as s}from"react/jsx-runtime";var o={band:"es-group-head",row:"es-group-sub"},l=e=>[...e].map(e=>/[A-Za-z0-9_-]/.test(e)?e:`-u${e.codePointAt(0).toString(16)}-`).join("");function t({items:t,defaultOpenIds:u=[],openIds:p,onOpenChange:m,allowMultiple:h=!1,level:N=3,tier:g="band",keepMounted:b=!1,className:$=""}){const v=e(),f=a(),[x,y]=i(u),I=d(),j=`h${N}`,k=p??x;/* @__PURE__ */
|
|
2
2
|
return r("div",{"data-accordion":g,className:$||void 0,children:t.map(e=>{const a=k.includes(e.id),i=e.headId??`${I}-${l(e.id)}-head`,d=e.headId?`${e.headId}-body`:`${I}-${l(e.id)}-panel`,t=a||b;/* @__PURE__ */
|
|
3
3
|
return c("div",{className:e.className?`es-group ${e.className}`:"es-group",children:[
|
|
4
4
|
/* @__PURE__ */r(j,{className:"es-group-title",children:/* @__PURE__ */c("button",{type:"button",id:i,disabled:e.disabled,"aria-expanded":a,"aria-controls":t?d:void 0,onClick:()=>(e=>{const a=k.includes(e)?k.filter(a=>a!==e):h?[...k,e]:[e];void 0===p&&y(a),m?.(a)})(e.id),className:o[g],children:[null!=e.icon&&/* @__PURE__ */r("span",{"aria-hidden":"true",className:"es-group-icon",children:e.icon}),e.title,"number"==typeof e.count&&e.count>0&&
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{FormField as e}from"./chunk-6KBDNYRW.js";import{dropzoneClass as t,zoneFocusClass as a,CloseGlyph as r}from"./chunk-
|
|
2
|
-
return o(e,{label:g,htmlFor
|
|
3
|
-
/* @__PURE__ */o("button",{ref:B,type:"button",id
|
|
1
|
+
import{FormField as e}from"./chunk-6KBDNYRW.js";import{dropzoneClass as t,zoneFocusClass as a,CloseGlyph as r}from"./chunk-Z5A4EY2R.js";import{useFileIntake as n,humanSize as i,FileIntakeAlert as s}from"./chunk-JTMEFXRL.js";import{useShellStrings as l}from"./chunk-GDQJBQ5B.js";import{forwardRef as c,useId as m}from"react";import{jsxs as o,jsx as d}from"react/jsx-runtime";var p=c(function({files:c,onChange:p,accept:u,acceptHint:h,multiple:x=!0,maxSizeBytes:b,maxFiles:f,disabled:y=!1,label:g,hint:N,error:j,required:k,className:v=""},B){const $=m(),z=l().files,C=n({accept:u,acceptHint:h,maxSizeBytes:b,maxFiles:f,multiple:x,disabled:y,currentCount:c.length,onAccept:e=>p(x?[...c,...e]:e.slice(0,1))}),F=j?`${$}-error`:N?`${$}-hint`:void 0;/* @__PURE__ */
|
|
2
|
+
return o(e,{label:g,htmlFor:$,hint:N,error:j,required:k,className:v,children:[
|
|
3
|
+
/* @__PURE__ */o("button",{ref:B,type:"button",id:$,disabled:y,onClick:C.open,"aria-invalid":!!j||void 0,"aria-required":k||void 0,"aria-describedby":F,...C.zoneProps,className:t(C.dragOver,y,a(y),"px-4 py-6"),children:[
|
|
4
4
|
/* @__PURE__ */o("span",{children:[
|
|
5
|
-
/* @__PURE__ */d("span",{className:"text-sm font-medium text-blue-600",children:x
|
|
6
|
-
/* @__PURE__ */d("span",{className:"text-sm text-gray-500",children:` ${x
|
|
7
|
-
/* @__PURE__ */d("input",{...
|
|
5
|
+
/* @__PURE__ */d("span",{className:"text-sm font-medium text-blue-600",children:x?z.chooseMany:z.chooseOne}),
|
|
6
|
+
/* @__PURE__ */d("span",{className:"text-sm text-gray-500",children:` ${x?z.dragMany:z.dragOne}`})]}),h&&/* @__PURE__ */d("span",{className:"text-xs text-gray-400",children:h})]}),
|
|
7
|
+
/* @__PURE__ */d("input",{...C.inputProps}),c.length>0&&/* @__PURE__ */d("ul",{className:"mt-2 flex flex-col gap-1",children:c.map((e,t)=>/* @__PURE__ */o("li",{className:"flex items-center justify-between gap-3 rounded-md bg-gray-50 px-3 py-2",children:[
|
|
8
8
|
/* @__PURE__ */d("span",{className:"min-w-0 flex-1 truncate text-sm text-gray-800",title:e.name,children:e.name}),
|
|
9
|
-
/* @__PURE__ */d("span",{className:"shrink-0 text-xs tabular-nums text-gray-500",children:i(e.size
|
|
10
|
-
/* @__PURE__ */d("button",{type:"button",disabled:y,onClick:()=>{
|
|
11
|
-
/* @__PURE__ */d(s,{rejections:
|
|
9
|
+
/* @__PURE__ */d("span",{className:"shrink-0 text-xs tabular-nums text-gray-500",children:i(e.size,z)}),
|
|
10
|
+
/* @__PURE__ */d("button",{type:"button",disabled:y,onClick:()=>{C.clearRejections(),p(c.filter((e,a)=>a!==t))},"aria-label":z.remove(e.name),className:"shrink-0 text-gray-400 hover:text-gray-600",children:/* @__PURE__ */d(r,{})})]},`${e.name}-${t}`))}),
|
|
11
|
+
/* @__PURE__ */d(s,{rejections:C.rejections})]})});export{p as FilePicker_default};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import{SearchableSelect as e}from"./chunk-XYBI57KO.js";import{Select_default as a}from"./chunk-SLU45G5J.js";import{labelClasses as l}from"./chunk-EQKUFYX6.js";import{isSafeLinkHref as t}from"./chunk-PJPK2ADX.js";import{Input_default as n}from"./chunk-MAMWQCJ6.js";import{INPUT_SIZES as r}from"./chunk-AYZY3YNC.js";import{Button_default as i}from"./chunk-I4VIEGCX.js";import{Icon as o}from"./chunk-2UO47XB4.js";import{registerModalEscapeInterceptor as s}from"./chunk-TWVUQUUD.js";import{useShellStrings as u}from"./chunk-GDQJBQ5B.js";import{useId as d,useRef as c,useState as p,useEffect as m}from"react";import{jsx as f,jsxs as v,Fragment as g}from"react/jsx-runtime";function h(e){return"select"===e.type?e.options:"groups"===e.type?e.groups.flatMap(e=>e.options):[]}var b="address",x={kindOf:()=>b,targetOf:e=>e,readFilter:()=>null,withFilter:e=>e},k=e=>t(e.trim());function y(t){const{value:r,kinds:o,rules:y=x,filtersFor:w,label:C,readOnly:N,placeholder:O,className:j=""}=t,F=void 0!==t.onApply,$=u().link,z=y.isSafe??k,A=d(),E=c(null),U=c(null),[D,P]=p({url:r}),Q=F?D.url:r,[X,Y]=p(!1),[B,J]=p(null),[K,M]=p(null),W=c(()=>{});W.current=F?t.onCancel:()=>{},m(()=>{if(F)return s(e=>{const a=E.current;return!!("Escape"===e.key&&a&&e.target instanceof Node&&a.contains(e.target))&&(W.current(),!0)},()=>E.current)},[F]),m(()=>{if(!F)return;const e=U.current;e?(e.focus(),e.select()):E.current?.querySelector("button, input")?.focus()},[]);const G=o??[{value:b,label:$.address,target:{type:"text"}}],I=B&&B.against===Q?B.kind:y.kindOf(Q),L=G.filter(e=>!e.hideWhenEmpty||h(e.target).length>0||e.value===I),S=L.find(e=>"text"===e.target.type),T=L.find(e=>e.value===I)??S??L[0];if(!T)return null;const R="text"!==T.target.type,V=R?y.targetOf(Q):Q,q=h(T.target),H=q.find(e=>e.value===V),Z=e=>({value:e,label:$.unavailable(e)}),_="select"===T.target.type&&V&&w?w(V):null,ee=_?y.readFilter(Q):null,ae=ee?_?.find(e=>e.param===ee.param):void 0,le=K&&K.against===Q?K.text:Q,te=!R&&""!==le.trim()&&!z(le),ne=te&&(!F||X),re=(e,a)=>{F?P({url:e,name:a}):void 0===a?t.onChange(e):t.onChange(e,a)},ie=(e,a)=>{J(a=>a?{...a,against:e}:a),re(e,a)},oe=e=>{if(!e)return ie("");const a=q.find(a=>a.value===e);ie(e,a?.label)},se=R?Q:le.trim(),ue=()=>{if(!F||!se)return;if(!R&&te)return void Y(!0);const e=R&&D.url===se?D.name:void 0,a=t.onApply;void 0===e?a(se):a(se,e)},de=(e,a)=>a&&!e.some(e=>e.value===a)?[Z(a),...e]:[...e],ce=(l,t,n,r,i)=>{const o=[];for(const e of n){const a=o[o.length-1],l={value:e.value,label:e.label};e.group?a&&"options"in a&&a.label===e.group?a.options.push(l):o.push({label:e.group,options:[l]}):o.push(l)}if(i){const a=n.some(e=>""===e.value);/* @__PURE__ */
|
|
2
|
+
return f(e,{"aria-label":l,value:t,options:o,disabled:N,clearable:a,placeholder:n.find(e=>""===e.value)?.label,onChange:r})}/* @__PURE__ */
|
|
3
|
+
return f(a,{size:"sm","aria-label":l,value:t,options:o,readOnly:N,onChange:r})};let pe;if("text"===T.target.type)pe=/* @__PURE__ */f(n,{ref:U,id:`${A}-address`,size:"sm",type:"text",invalid:ne,"aria-label":$.address,"aria-describedby":ne?`${A}-why`:void 0,placeholder:O??$.addressPlaceholder,spellCheck:!1,autoComplete:"off",value:le,readOnly:N,onChange:e=>(e=>{Y(!1);const a=e.trim();a?z(e)?(M({text:e,against:a}),ie(a)):M({text:e,against:Q}):(M({text:e,against:""}),ie(""))})(e.target.value)});else{const e="groups"===T.target.type?T.target.groups.flatMap(e=>e.options.map(a=>({value:a.value,label:a.label,group:e.label}))):T.target.options.map(e=>({value:e.value,label:e.label})),a=[{value:"",label:T.target.placeholder},...de(e,V)];pe=ce(T.label,V,a,oe,e.length>10)}const me=/* @__PURE__ */v(g,{children:[o&&ce($.linkType,T.value,L.map(e=>({value:e.value,label:e.label})),e=>{M(null),Y(!1);const a=L.find(a=>a.value===e);if(!a||"text"===a.target.type)return void J({kind:e,against:Q});const l=h(a.target)[0];J({kind:e,against:l?l.value:""}),l?re(l.value,l.label):re("")},!1),pe,_&&ce($.filter,ee?.param??"",[{value:"",label:$.noFilter},...ee&&!ae?[Z(ee.param)]:[],..._.map(e=>({value:e.param,label:e.label}))],e=>{if(!e)return ie(V,H?.label);const a=_?.find(a=>a.param===e),l=a?.values[0];l&&ie(y.withFilter(V,{param:e,value:l.value}),l.label)},!1),_&&ee&&ce($.value,ee.value,de((ae?.values??[]).map(e=>({value:e.value,label:e.label})),ee.value),e=>{if(!ee)return;const a=ae?.values.find(a=>a.value===e);ie(y.withFilter(V,{param:ee.param,value:e}),a?.label)},(ae?.values.length??0)>10),ne&&/* @__PURE__ */f("p",{id:`${A}-why`,role:"alert",className:"text-2xs leading-4 text-red-600",children:$.unsafe}),T.hint&&/* @__PURE__ */f("p",{className:"text-2xs leading-4 text-ink-faintest",children:T.hint}),_&&/* @__PURE__ */f("p",{className:"text-2xs leading-4 text-ink-faintest",children:$.filterHint})]});if(!F)/* @__PURE__ */
|
|
4
|
+
return f("div",{ref:E,className:`flex min-w-0 flex-auto flex-col gap-2 ${j}`.trim(),role:C?"group":void 0,"aria-label":C,children:me});const fe=t.onRemove;/* @__PURE__ */
|
|
5
|
+
return v("div",{ref:E,role:"dialog","aria-label":C??$.title,className:`flex min-w-0 flex-col gap-2 rounded-xl border border-line bg-surface p-3 shadow-lg ${j}`.trim(),onKeyDown:e=>{"Enter"!==e.key||e.defaultPrevented||e.target instanceof Element&&e.target.closest("button")||(e.preventDefault(),ue())},children:[R?/* @__PURE__ */f("span",{className:l({inline:!0}),children:$.title}):/* @__PURE__ */f("label",{htmlFor:`${A}-address`,className:l({inline:!0}),children:$.title}),me,
|
|
6
|
+
/* @__PURE__ */v("div",{className:"flex items-center justify-between gap-2",children:[fe?/* @__PURE__ */f(i,{variant:"ghost-danger",size:"sm","data-window-action":"remove",onClick:fe,children:$.remove}):null,
|
|
7
|
+
/* @__PURE__ */v("span",{className:"ml-auto flex gap-1",children:[
|
|
8
|
+
/* @__PURE__ */f(i,{variant:"secondary",size:"sm","data-window-action":"cancel",onClick:()=>W.current(),children:$.cancel}),
|
|
9
|
+
/* @__PURE__ */f(i,{variant:"primary",size:"sm","data-window-action":"apply",onClick:ue,disabled:N||""===se,children:$.apply})]})]})]})}function w({label:e,text:a,onTextChange:l,link:t,onLinkChange:i,kinds:s,rules:m,filtersFor:g,textPlaceholder:h,readOnly:b,className:x=""}){const k=u().link,[w,C]=p(!1),N=c(null),O=d(),j=()=>{C(!1),N.current?.focus()};/* @__PURE__ */
|
|
10
|
+
return v("div",{className:`flex min-w-0 flex-auto flex-col ${x}`.trim(),children:[
|
|
11
|
+
/* @__PURE__ */f(n,{size:"md",type:"text",className:"rounded-b-none","aria-label":k.text(e),placeholder:h,value:a,readOnly:b,onChange:e=>l(e.target.value)}),
|
|
12
|
+
/* @__PURE__ */v("button",{ref:N,type:"button","aria-label":k.linkOf(e,t),"aria-expanded":w,"aria-controls":w?O:void 0,disabled:b,onClick:()=>C(e=>!e),className:`flex w-full min-w-0 items-center gap-2 rounded-b-(--radius-control) border border-t-0 border-line-strong bg-surface-sunken ${r.md} text-left hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)] disabled:cursor-not-allowed disabled:opacity-60`,children:[
|
|
13
|
+
/* @__PURE__ */f(o,{name:"link",strokeWidth:1.5,className:"h-4 w-4 shrink-0 "+(t?"text-blue-600":"text-ink-faintest")}),
|
|
14
|
+
/* @__PURE__ */f("span",{className:"min-w-0 truncate "+(t?"text-blue-600":"text-ink-faintest"),children:t||k.addLink})]}),w&&/* @__PURE__ */f("div",{id:O,className:"mt-2",children:/* @__PURE__ */f(y,{value:t,label:k.linkOf(e,t),kinds:s,rules:m,filtersFor:g,onApply:(e,a)=>{void 0===a?i(e):i(e,a),j()},onRemove:t?()=>{i(""),j()}:void 0,onCancel:j})})]})}export{y as LinkPicker,w as TextLinkField};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";function r({size:r=18,...i}){/* @__PURE__ */
|
|
2
|
+
return e("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",...i,children:/* @__PURE__ */e("path",{fillRule:"evenodd",d:"M6,7.5h12c0.2766,0 0.53074,0.15224 0.66126,0.39611c0.13051,0.24387 0.11621,0.53978 -0.03722,0.76992l-6,9c-0.1391,0.20865 -0.37327,0.33397 -0.62404,0.33397c-0.25076,0 -0.48494,-0.12533 -0.62404,-0.33397l-6,-9c-0.15343,-0.23014 -0.16773,-0.52605 -0.03722,-0.76992c0.13051,-0.24387 0.38466,-0.39611 0.66126,-0.39611z"})})}export{r as SeparatorTriangleSolidIcon};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{ErrorPage as r}from"./chunk-
|
|
1
|
+
import{ErrorPage as r}from"./chunk-ORIXCEKO.js";import{reportBoundaryError as e}from"./chunk-KNUR2UEG.js";import{Button_default as t}from"./chunk-I4VIEGCX.js";import{useShellStrings as s}from"./chunk-GDQJBQ5B.js";import{Component as o}from"react";import{jsxs as i,jsx as a,Fragment as n}from"react/jsx-runtime";function c({pick:r}){/* @__PURE__ */
|
|
2
2
|
return a(n,{children:r(s().errors)})}var l=class extends o{state={error:null};static getDerivedStateFromError(r){return{error:r}}componentDidCatch(r,t){console.error("ErrorBoundary caught an error:",r,t),e(r),this.props.onError?.(r,t)}componentDidUpdate(r){if(!this.state.error)return;const e=r.resetKeys??[],t=this.props.resetKeys??[];(e.length!==t.length||e.some((r,e)=>!Object.is(r,t[e])))&&this.reset()}reset=()=>this.setState({error:null});render(){const{error:e}=this.state;return e?this.props.fallback?this.props.fallback(e,this.reset):
|
|
3
3
|
/* @__PURE__ */i("div",{className:"flex h-full flex-col",children:[
|
|
4
4
|
/* @__PURE__ */a("div",{role:"alert",className:"min-h-0 flex-1",children:/* @__PURE__ */a(r,{code:500,actions:/* @__PURE__ */i(n,{children:[
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{CHART_INK as l}from"./chunk-TZFACUMR.js";import{useShellStrings as e}from"./chunk-
|
|
1
|
+
import{CHART_INK as l}from"./chunk-TZFACUMR.js";import{useShellStrings as e}from"./chunk-GDQJBQ5B.js";import{useState as n,useEffect as t}from"react";import{jsxs as r,jsx as a}from"react/jsx-runtime";function o(l,e=!0){const[r,a]=n(null),[o,s]=n(null),[i,c]=n(null);t(()=>{a(null)},[l]),t(()=>{if(null===o)return;const l=()=>{s(null),c(null)};return window.addEventListener("pointerup",l),()=>window.removeEventListener("pointerup",l)},[o]);const u=r?r[0]:0,m=null!==o&&null!==i&&o!==i?[Math.min(o,i),Math.max(o,i)]:null;return{view:e?r:null,drag:e?m:null,press:l=>{e&&(s(l),c(l))},over:l=>{null!==o&&c(l)},release:()=>{m&&a([u+m[0],u+m[1]]),s(null),c(null)},clear:()=>a(null),slice:l=>e&&r?l.slice(r[0],r[1]+1):l}}function s({from:n,to:t,count:o,total:s,rows:i,onClear:c}){const u=e().charts;/* @__PURE__ */
|
|
2
2
|
return r("div",{className:"mt-1 text-xs","data-chart-zoom":"true",children:[
|
|
3
3
|
/* @__PURE__ */r("div",{className:"flex items-baseline gap-2",children:[
|
|
4
4
|
/* @__PURE__ */a("span",{className:"font-semibold",style:{color:l.label},children:u.zoomRange(n,t,o)}),void 0!==s&&/* @__PURE__ */a("span",{className:"tabular-nums",style:{color:l.label},children:s}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useShellLocale as e}from"./chunk-
|
|
1
|
+
import{useShellLocale as e}from"./chunk-GDQJBQ5B.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};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import{Tree as e,TreeRow as n,TreeGroup as l}from"./chunk-RUGQO7YF.js";import{MarqueeBox as a}from"./chunk-IC72MGON.js";import{EmptyState as i}from"./chunk-QVZKRROQ.js";import{ImageLightbox as r}from"./chunk-VIQ6OME2.js";import{DescriptionList as t}from"./chunk-SACUSHVN.js";import{Drawer as o}from"./chunk-V6Y4OC6K.js";import{Breadcrumbs as d}from"./chunk-XYECIBVX.js";import{useGridSelection as s}from"./chunk-VLKDWKVR.js";import{useMarquee as c}from"./chunk-OLFYNMTD.js";import{ROOT_KEY as u,mediaLibraryMenu as m}from"./chunk-MS5APD3V.js";import{useMediaMoveItems as p}from"./chunk-OPN4I565.js";import{DropdownMenu as h}from"./chunk-PN5FQVMB.js";import{copyToClipboard as f}from"./chunk-TMMNCXQT.js";import{NativeSelect as g}from"./chunk-SLU45G5J.js";import{MediaUploadGrid as v}from"./chunk-3UXXA2CS.js";import{MediaUsedInList as k}from"./chunk-UDKTAG57.js";import{Segmented as y}from"./chunk-3ELLBQPS.js";import{Checkbox_default as b}from"./chunk-CGZBDI6C.js";import{useContextMenu as w,ContextMenu as x}from"./chunk-W3OWPBQL.js";import{Banner as C}from"./chunk-ZGOHRLXG.js";import{Input_default as N}from"./chunk-MAMWQCJ6.js";import{IconButton_default as I}from"./chunk-PUF75SMJ.js";import{useFileIntake as D,FileIntakeAlert as S}from"./chunk-JTMEFXRL.js";import{ColoredBadge as j}from"./chunk-EPY34L26.js";import{Button_default as z}from"./chunk-I4VIEGCX.js";import{buttonClasses as F}from"./chunk-UQYNPYF4.js";import{Icon as O}from"./chunk-2UO47XB4.js";import{Tooltip as T}from"./chunk-6XBWM453.js";import{usePlotWidth as L}from"./chunk-MAFUXCPZ.js";import{useShellStrings as P}from"./chunk-GDQJBQ5B.js";import{useRef as E,useMemo as M,useCallback as A,useState as U,useEffect as B}from"react";import{jsxs as R,Fragment as K,jsx as Q}from"react/jsx-runtime";var V="application/x-efficient-media-files",G="application/x-efficient-media-folder",X="application/x-efficient-media-file";function J(e){if(!e||!Array.from(e.types).includes(X))return null;try{const n=JSON.parse(e.getData(X));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 W={type:"all",use:"any",sort:"newest"},Y={lock:/* @__PURE__ */Q(O,{name:"lock","aria-hidden":"true",className:"h-4 w-4"}),folder:/* @__PURE__ */Q(O,{name:"folder","aria-hidden":"true",className:"h-4 w-4"}),folderOpen:/* @__PURE__ */Q(O,{name:"folder-open","aria-hidden":"true",className:"h-4 w-4"}),folderPlus:/* @__PURE__ */Q(O,{name:"folder-plus","aria-hidden":"true",className:"h-4 w-4"}),trash:/* @__PURE__ */Q(O,{name:"trash","aria-hidden":"true",className:"h-4 w-4"}),upload:/* @__PURE__ */Q(O,{name:"upload","aria-hidden":"true",className:"h-4 w-4"}),search:/* @__PURE__ */Q(O,{name:"search","aria-hidden":"true",className:"h-4 w-4"}),grid:/* @__PURE__ */Q(O,{name:"grid","aria-hidden":"true",className:"h-4 w-4"}),list:/* @__PURE__ */Q(O,{name:"list","aria-hidden":"true",className:"h-4 w-4"}),more:/* @__PURE__ */Q(O,{name:"more","aria-hidden":"true",className:"h-4 w-4"}),copy:/* @__PURE__ */Q(O,{name:"copy","aria-hidden":"true",className:"h-4 w-4"}),edit:/* @__PURE__ */Q(O,{name:"edit","aria-hidden":"true",className:"h-4 w-4"}),swap:/* @__PURE__ */Q(O,{name:"swap","aria-hidden":"true",className:"h-4 w-4"}),crop:/* @__PURE__ */Q(O,{name:"crop","aria-hidden":"true",className:"h-4 w-4"}),external:/* @__PURE__ */Q(O,{name:"external","aria-hidden":"true",className:"h-4 w-4"}),undo:/* @__PURE__ */Q(O,{name:"undo","aria-hidden":"true",className:"h-4 w-4"})},$={link:/* @__PURE__ */Q(O,{name:"link","aria-hidden":"true",className:"h-3 w-3"}),email:/* @__PURE__ */Q(O,{name:"email","aria-hidden":"true",className:"h-3 w-3"}),lock:/* @__PURE__ */Q(O,{name:"lock","aria-hidden":"true",className:"h-3 w-3"}),clock:/* @__PURE__ */Q(O,{name:"clock","aria-hidden":"true",className:"h-3 w-3"})};function H({value:e,label:n,onDone:l}){const[a,i]=U(e),r=E(!1),t=e=>{r.current||(r.current=!0,l(e))};/* @__PURE__ */
|
|
2
|
+
return Q(N,{size:"sm",autoFocus:!0,"aria-label":n,value:a,onChange:e=>i(e.target.value),onFocus:e=>e.currentTarget.select(),onKeyDown:n=>{n.stopPropagation(),"Enter"===n.key?(n.preventDefault(),t(a.trim()||e)):"Escape"===n.key&&(n.preventDefault(),t(null))},onBlur:()=>t(a.trim()||e),onClick:e=>e.stopPropagation()})}function q(O){const{mode:J="manage",layout:q="auto",location:Z,onLocationChange:_,folders:ee,products:ne,allFilesCount:le,trashCount:ae,files:ie,query:re,onQueryChange:te,filters:oe=W,onFiltersChange:de,extraFilters:se,view:ce="grid",onViewChange:ue,selectedIds:me,onSelectionChange:pe,usedIn:he,denied:fe={},accept:ge="image/*,video/*",maxSizeBytes:ve,busy:ke,progress:ye,onUpload:be,onNewFolder:we,onRename:xe,onMove:Ce,onTrash:Ne,onDeleteFolder:Ie,onRestore:De,onDeleteForever:Se,onEmptyTrash:je,onReplace:ze,onCropEdit:Fe,onOpenInDesign:Oe,onChoose:Te,onCancel:Le,pickNote:Pe,onDragOut:Ee,className:Me=""}=O,Ae=P().mediaLibrary,Ue=P().media,Be="pick"===J,Re=!Be,Ke=E(null),Qe=L(Ke,"phone"===q?343:1200),Ve="phone"===q||"auto"===q&&Qe<640,Ge=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]),Xe=M(()=>new Map(ee.map(e=>[e.id,e])),[ee]),Je=M(()=>{const e=/* @__PURE__ */new Map;for(const n of ee){const l=n.parentId&&Xe.has(n.parentId)?n.parentId:null;e.set(l,[...e.get(l)??[],n])}return e},[ee,Xe]),We=A(e=>{const n=[];for(let l=e?Xe.get(e):void 0;l&&(n.unshift(l),!(n.length>ee.length));l=l.parentId?Xe.get(l.parentId):void 0);return n},[Xe,ee.length]),Ye=A((e,n)=>We(e).some(e=>e.id===n),[We]),[$e,He]=U(()=>/* @__PURE__ */new Set(["@files"])),qe=e=>He(n=>{const l=new Set(n);return l.has(e)?l.delete(e):l.add(e),l}),Ze=A(e=>{He(n=>e.every(e=>n.has(e))?n:/* @__PURE__ */new Set([...n,...e]))},[]),_e="files"===(en=Z).place?`files:${en.folderId??""}`:"products"===en.place?`products:${en.nodeId??""}`:"trash";var en;B(()=>{if("files"===Z.place)Ze(["@files",...We(Z.folderId).slice(0,-1).map(e=>e.id)]);else if("products"===Z.place){const e=Z.nodeId?Ge.get(Z.nodeId)?.path??[]:[];Ze(["@products",...e.slice(0,-1).map(e=>`p:${e.id}`)])}},[_e]);const nn="products"===Z.place,ln="trash"===Z.place,an="files"===Z.place,rn=an?Z.folderId:null,tn=nn&&Z.nodeId?Ge.get(Z.nodeId)?.path[0]:void 0,on=e=>e?.sharedFrom?`${Ae.readOnly} ${Ae.editedAtHq(e.sharedFrom)}`:Ae.readOnly,dn=M(()=>ie.map(e=>e.id),[ie]),sn=M(()=>new Map(ie.map(e=>[e.id,e])),[ie]),cn=s(dn),un=M(()=>dn.filter(e=>cn.selected.has(e)),[dn,cn.selected]),mn=1===un.length?sn.get(un[0]):void 0,pn=E(!0);B(()=>{pn.current?pn.current=!1:cn.clear()},[_e]);const hn=me?.join("\0");B(()=>{me&&cn.setSelection(me)},[hn]);const fn=E(hn??""),gn=un.join("\0");B(()=>{fn.current!==gn&&(fn.current=gn,pe?.(un))},[gn]);const vn=(e,n={})=>{Be?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?Xe.get(n.id)?.name:sn.get(n.id)?.name)&&xe?.(n,e)},wn=async e=>{if(!we)return;const n=await we(e);Ze(["@files",...e?[e]:[]]),"string"==typeof n&&yn({kind:"folder",id:n})},xn=A(e=>{const n=[],l=n=>{if("files"===e.kind)return n===rn&&an?Ae.alreadyHere:void 0;const l=Xe.get(e.id);return n===e.id||n&&Ye(n,e.id)?Ae.notIntoItself:(l?.parentId??null)===n?Ae.folderAlreadyHere:void 0};n.push({key:u,label:Ae.allFiles,disabledReason:l(null)});const a=(e,i)=>{for(const r of Je.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},[Je,Xe,an,Ye,rn,Ae]),Cn=A(e=>{const n=new Set(e.map(e=>sn.get(e)?.kind??"image"));return 1===n.size?[...n][0]:"file"},[sn]),[Nn,In]=U(null),Dn={words:Ae,media:Ue,denied:fe,moveTargets:xn,kindOf:Cn,urlOf:e=>sn.get(e)?.url,newSubfolder:we&&Re?e=>{wn(e)}:void 0,rename:xe&&Re?e=>{"file"!==e.kind||cn.isSelected(e.id)||cn.select(e.id),yn(e)}:void 0,move:Ce&&Re?Ce:void 0,trash:Ne&&Re?Ne:void 0,deleteFolder:Ie&&Re?Ie:void 0,folderNotEmpty:e=>!!Xe.get(e)?.notEmpty,replace:ze&&Re?ze:void 0,copyUrl:e=>{const n=sn.get(e)?.url;n&&f(Ae.urlLabel,n)},openInDesign:Oe,restore:De,deleteForever:Se},Sn=e=>m(e,Dn),jn=w(),zn=(e,n)=>{Be||(cn.isSelected(e)||cn.select(e),jn.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)))},[Fn,On]=U(null),[Tn,Ln]=U(null),[Pn,En]=U(null);B(()=>{if(!Tn&&!Fn)return;const e=()=>{Ln(null),On(null)};return window.addEventListener("dragend",e),window.addEventListener("drop",e),()=>{window.removeEventListener("dragend",e),window.removeEventListener("drop",e)}},[Tn,Fn]);const Mn=(e,n)=>Array.from(e.dataTransfer?.types??[]).includes(n),An=(e,n)=>!(!Ce||fe.move||Be)&&(!!Mn(e,V)||!(!Mn(e,G)||!Pn)&&(n!==Pn&&!(n&&Ye(n,Pn)))),Un=(e,n)=>({onDragEnter:l=>{An(l,n)&&(l.preventDefault(),On(e))},onDragOver:l=>{An(l,n)&&(l.preventDefault(),l.dataTransfer.dropEffect="move",Fn!==e&&On(e))},onDragLeave:n=>{const l=n.relatedTarget;l&&n.currentTarget.contains(l)||On(n=>n===e?null:n)},onDrop:e=>{if(An(e,n))if(e.preventDefault(),On(null),Mn(e,V)){let l;try{l=JSON.parse(e.dataTransfer.getData(V))}catch{l=null}Array.isArray(l)&&l.length&&Ce({kind:"files",ids:l.map(String)},n)}else Pn&&(Ce({kind:"folder",id:Pn},n),En(null))}}),Bn=e=>{const n=e=>Mn(e,V)||Mn(e,G)||Mn(e,"Files");return{onDragEnter:l=>{n(l)&&Ln(e)},onDragOver:l=>{n(l)&&Tn!==e&&Ln(e)},onDragLeave:n=>{const l=n.relatedTarget;l&&n.currentTarget.contains(l)||Ln(n=>n===e?null:n)}}},Rn=(e,n,l)=>/* @__PURE__ */Q(T,{side:"right",content:Tn===e?Ae.noDropProducts:on(l),open:Tn===e||!Tn&&void 0,children:/* @__PURE__ */Q("span",{children:n})}),Kn=e=>({onContextMenu:n=>{jn.open(n,e)}}),Qn=(e,a,i)=>e.map(e=>{const r=`p:${e.id}`,t=i??e,o=$e.has(r),d=e.children?.length?e.children:null;/* @__PURE__ */
|
|
3
|
+
return R("div",{role:"none",className:"contents",children:[
|
|
4
|
+
/* @__PURE__ */Q(n,{label:Rn(r,e.name,t),level:a,icon:d&&o?Y.folderOpen:Y.folder,count:e.count,countLabel:null!=e.count?e.countLabel??Ae.fileCount(e.count):void 0,selected:nn&&Z.nodeId===e.id,expanded:d?o:void 0,onToggle:d?()=>qe(r):void 0,onSelect:()=>_({place:"products",nodeId:e.id}),rowProps:{"data-media-row":r,...Bn(r),...Re?Kn({kind:"product-node",id:e.id}):{}}}),d&&o&&/* @__PURE__ */Q(l,{children:Qn(d,a+1,t)})]},e.id)}),Vn=(e,a)=>(Je.get(e)??[]).map(e=>{const i=Je.get(e.id),r=$e.has(e.id),t="folder"===kn?.kind&&kn.id===e.id,o=Sn({kind:"folder",id:e.id});/* @__PURE__ */
|
|
5
|
+
return R("div",{role:"none",className:"contents",children:[
|
|
6
|
+
/* @__PURE__ */Q(n,{label:e.name,level:a,icon:i&&r?Y.folderOpen:Y.folder,count:e.count,countLabel:null!=e.count?e.countLabel??Ae.fileCount(e.count):void 0,selected:t||an&&Z.folderId===e.id,expanded:i?r:void 0,onToggle:i?()=>qe(e.id):void 0,onSelect:()=>_({place:"files",folderId:e.id}),drop:Fn===e.id?"into":void 0,dragging:Pn===e.id,draggable:Re&&!!Ce&&!fe.move,rename:t?/* @__PURE__ */Q(H,{value:e.name,label:Ae.folderName,onDone:bn}):void 0,actions:Re&&o.length?/* @__PURE__ */Q(h,{align:"end","aria-label":Ae.folderActions,trigger:Y.more,items:o}):void 0,rowProps:{"data-media-row":e.id,...Un(e.id,e.id),...Re?Kn({kind:"folder",id:e.id}):{},...Re&&Ce&&!fe.move?{draggable:!0,onDragStart:n=>{n.dataTransfer.effectAllowed="move",n.dataTransfer.setData(G,e.id),En(e.id)},onDragEnd:()=>{En(null),On(null)}}:{}}}),i&&r&&/* @__PURE__ */Q(l,{children:Vn(e.id,a+1)})]},e.id)}),Gn=$e.has("@files"),Xn=$e.has("@products"),Jn=/* @__PURE__ */R(e,{"aria-label":Ae.folders,children:[ne&&/* @__PURE__ */R(K,{children:[
|
|
7
|
+
/* @__PURE__ */Q(n,{label:Rn("@products",Ae.products),level:1,icon:Y.lock,badge:{label:Ae.readOnlyBadge,tone:"neutral"},expanded:ne.length?Xn:void 0,onToggle:()=>qe("@products"),selected:nn&&null==Z.nodeId,onSelect:()=>_({place:"products",nodeId:null}),rowProps:{"data-media-row":"@products",...Bn("@products")}}),Xn&&ne.length>0&&/* @__PURE__ */Q(l,{children:Qn(ne,2)})]}),
|
|
8
|
+
/* @__PURE__ */Q(n,{label:Ae.allFiles,level:1,icon:Gn?Y.folderOpen:Y.folder,count:le,countLabel:null!=le?Ae.fileCount(le):void 0,expanded:Je.get(null)?.length?Gn:void 0,onToggle:()=>qe("@files"),selected:an&&null==Z.folderId,onSelect:()=>_({place:"files",folderId:null}),drop:"@files"===Fn?"into":void 0,rowProps:{"data-media-row":"@files",...Un("@files",null)}}),Gn&&(Je.get(null)?.length??0)>0&&/* @__PURE__ */Q(l,{children:Vn(null,2)}),Re&&/* @__PURE__ */Q(n,{label:Ae.trash,level:1,icon:Y.trash,count:ae,countLabel:null!=ae?Ae.fileCount(ae):void 0,selected:ln,onSelect:()=>_({place:"trash"}),rowProps:{"data-media-row":"@trash"}})]}),Wn=(()=>{if(ln)return[{label:Ae.trash}];if(nn){const e=Z.nodeId?Ge.get(Z.nodeId)?.path??[]:[];return[{label:Ae.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=We(rn);return[{label:Ae.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}))]})(),Yn=nn?Ae.readOnly:fe.upload,$n=!!be&&!ln&&!Yn,Hn=D({accept:ge,maxSizeBytes:ve,multiple:!0,disabled:!$n,onAccept:e=>be?.(e,rn)}),qn=nn?Ae.noProductFolder:fe.newFolder,Zn=e=>e?{"aria-disabled":!0,disabledReason:e}:{},_n=/* @__PURE__ */R("div",{className:"flex flex-wrap items-center gap-2",children:[Re&&we&&!ln&&/* @__PURE__ */Q(z,{variant:"secondary",size:"sm",leftIcon:Y.folderPlus,onClick:()=>{wn(rn)},...Zn(qn),children:Ae.newFolder}),be&&!ln&&/* @__PURE__ */Q(z,{variant:"primary",size:"sm",leftIcon:Y.upload,onClick:()=>Hn.open(),...Zn(Yn),children:Ae.upload}),Re&&ln&&je&&ie.length>0&&/* @__PURE__ */Q(z,{variant:"danger",size:"sm",onClick:je,...Zn(fe.deleteForever),children:Ae.emptyTrash})]}),el=(e,n,l,a,i)=>/* @__PURE__ */Q("div",{style:{width:Ve?void 0:i,flex:Ve?"1 1 120px":"0 0 auto",minWidth:0},children:/* @__PURE__ */Q(g,{size:"sm","aria-label":e,value:n,onChange:a,options:l})},e),nl=e=>n=>de?.({...oe,[e]:n}),ll=/* @__PURE__ */R("div",{className:"flex flex-wrap items-center gap-2",children:[te&&/* @__PURE__ */Q("div",{style:{flex:"1 1 200px",minWidth:0},children:/* @__PURE__ */Q(N,{size:"sm",type:"search",leftIcon:Y.search,placeholder:nn?Ae.searchProducts:Ae.search,"aria-label":nn?Ae.searchProducts:Ae.search,value:re??"",onChange:e=>te(e.target.value)})}),de&&el(Ae.mediaType,oe.type,[{value:"all",label:Ae.allTypes},{value:"image",label:Ae.images},{value:"video",label:Ae.videos},{value:"svg",label:"SVG"},{value:"gif",label:"GIF"}],nl("type"),130),de&&!nn&&!ln&&el(Ae.use,oe.use,[{value:"any",label:Ae.anyUse},{value:"email",label:Ae.emailOnly},{value:"website",label:Ae.websiteOnly},{value:"unused",label:Ae.notUsed}],nl("use"),130),de&&Re&&el(Ae.sort,oe.sort,[{value:"newest",label:Ae.newest},{value:"name",label:Ae.byName},{value:"size",label:Ae.bySize}],nl("sort"),110),se?.map(e=>el(e.label,e.value,e.options,e.onChange,120)),ue&&/* @__PURE__ */Q(y,{size:"sm",label:Ae.view,value:ce,onChange:ue,options:[{value:"grid",label:Ae.grid,icon:Y.grid},{value:"list",label:Ae.list,icon:Y.list}]})]}),al=e=>{const n=[];return null!=e.trashedDaysAgo&&n.push({key:"t",label:Ae.daysAgo(e.trashedDaysAgo),count:e.trashedDaysAgo,icon:$.clock,tone:"neutral"}),e.usedCount&&n.push({key:"u",label:Ae.used(e.usedCount),count:e.usedCount,icon:$.link,tone:"active"}),e.email&&n.push({key:"e",label:Ae.email,icon:$.email,tone:"queued"}),e.private&&n.push({key:"p",label:Ae.private,icon:$.lock,tone:"neutral"}),n},il=e=>al(e).map(e=>/* @__PURE__ */Q(j,{tone:e.tone,size:"xs",children:e.label},e.key)),rl=Re&&an&&!!Ce&&!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:{[X]:ol(e)}}:{}})),sl=Ve?Math.max(72,Math.floor((Qe-24-16-1)/3)):112,cl=E(null),ul=c({containerRef:cl,enabled:Re&&!Ve&&ie.length>0,selected:cn.selected,setSelection:e=>cn.setSelection(e),clearSelection:cn.clear}),ml=e=>{if(Be){const n=sn.get(e);return void(!n||n.private||n.pickDisabledReason||Te?.(n))}const n=dn.indexOf(e);n>=0&&In(n)},pl=ie.length?null:re?/* @__PURE__ */Q(i,{variant:"dashed",title:Ae.noMatches}):nn?/* @__PURE__ */Q(i,{variant:"dashed",title:Ae.emptyProducts,description:on(tn)}):ln?/* @__PURE__ */Q(i,{variant:"dashed",title:Ae.trashEmpty}):!$n||Be?/* @__PURE__ */Q(i,{variant:"dashed",title:Ae.emptyFolder}):null,hl="list"===ce&&ie.length>0,fl=pl??(hl?/* @__PURE__ */Q("ul",{role:"listbox","aria-multiselectable":Re||void 0,"aria-label":Ae.folders,className:"flex flex-col gap-1",children:ie.map(e=>/* @__PURE__ */R("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(X,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:[
|
|
9
|
+
/* @__PURE__ */Q("img",{src:e.thumbUrl??e.url,alt:"",className:"h-10 w-10 shrink-0 rounded bg-gray-100 object-contain"}),
|
|
10
|
+
/* @__PURE__ */Q("span",{className:"min-w-0 flex-1 truncate",children:e.name}),
|
|
11
|
+
/* @__PURE__ */Q("span",{className:"flex shrink-0 items-center gap-1",children:il(e)}),e.sizeLabel&&/* @__PURE__ */Q("span",{className:"w-16 shrink-0 text-right text-xs text-ink-faint",children:e.sizeLabel})]},e.id))}):/* @__PURE__ */Q(v,{items:dl,readOnly:!$n||Be,onFiles:$n&&!Be?e=>be(e,rn):void 0,accept:ge,maxSizeBytes:ve,busy:ke,progress:ye,fit:"contain",thumbSize:sl,dragType:rl?V:tl?X:void 0,onDragOutChange:tl?e=>Ee(e):void 0,selected:cn.selected,onItemClick:vn,onItemDoubleClick:ml,onItemContextMenu:Re?zn:void 0,menuOnMedia:Re})),gl=p({count:un.length,kind:Cn(un),targets:xn({kind:"files",ids:un}),onPick:e=>Ce?.({kind:"files",ids:un},e.key===u?null:e.key)}),vl=F({variant:"secondary",size:"sm"}),kl=/* @__PURE__ */Q(h,{align:"start",triggerClassName:vl,trigger:/* @__PURE__ */R(K,{children:[Y.folder,Ae.moveTo]}),items:gl,disabled:!!fe.move}),yl=Re&&un.length>1&&!nn?/* @__PURE__ */R("div",{"data-media-bulk":"",className:"flex flex-wrap items-center gap-2 rounded-lg border border-line px-3 py-2",children:[
|
|
12
|
+
/* @__PURE__ */Q(b,{checked:un.length===ie.length,indeterminate:un.length<ie.length,onChange:e=>e?cn.selectAll():cn.clear(),label:Ae.selected(un.length)}),/* @__PURE__ */R(K,ln?{children:[De&&/* @__PURE__ */Q(z,{variant:"secondary",size:"sm",leftIcon:Y.undo,onClick:()=>De(un),...Zn(fe.restore),children:Ae.restore}),Se&&/* @__PURE__ */Q(z,{variant:"secondary-danger",size:"sm",onClick:()=>Se(un),...Zn(fe.deleteForever),children:Ae.deleteForever})]}:{children:[Ce&&kl,xe&&/* @__PURE__ */Q(z,{variant:"secondary",size:"sm",leftIcon:Y.edit,disabled:!0,children:Ae.rename}),Ne&&/* @__PURE__ */Q(z,{variant:"secondary",size:"sm",leftIcon:Y.trash,onClick:()=>Ne({kind:"files",ids:un}),...Zn(fe.trash),children:Ae.moveFilesToTrash(un.length)})]}),
|
|
13
|
+
/* @__PURE__ */Q(z,{variant:"ghost",size:"sm",onClick:cn.clear,children:Ae.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",Ae.name,a?/* @__PURE__ */Q(H,{value:e.name,label:Ae.fileName,onDone:bn}):e.name),l("type",Ae.type,e.typeLabel),l("size",Ae.size,e.sizeLabel),l("resolution",Ae.resolution,e.resolution),nn?(l("design",Ae.design,e.design),l("finish",Ae.finish,e.finish),l("angle",Ae.angleLug,e.angleLug),l("owner",Ae.owner,e.owner)):(l("added",Ae.addedBy,e.addedBy),l("folder",Ae.folder,e.folderPath)),l("used",Ae.usedIn,null!=e.usedCount?Ae.places(e.usedCount):void 0);const i=m({kind:"files",ids:[e.id]},Dn).find(e=>"submenu"===e.type);/* @__PURE__ */
|
|
14
|
+
return R("div",{"data-media-details":"",className:"flex flex-col gap-3",children:[
|
|
15
|
+
/* @__PURE__ */Q("img",{src:e.url,alt:e.name,className:"aspect-square w-full rounded-lg bg-gray-100 object-contain"}),nn&&/* @__PURE__ */Q(C,{tone:"neutral",title:Ae.readOnlyBadge,children:on(tn)}),
|
|
16
|
+
/* @__PURE__ */Q(t,{size:"sm",columns:1,items:n}),!ln&&/* @__PURE__ */R("div",{className:"flex gap-2",children:[
|
|
17
|
+
/* @__PURE__ */Q("div",{style:{flex:"1 1 0",minWidth:0},children:/* @__PURE__ */Q(N,{size:"sm",readOnly:!0,value:e.url,"aria-label":Ae.fileUrl,onFocus:e=>e.currentTarget.select()})}),
|
|
18
|
+
/* @__PURE__ */Q(z,{variant:"secondary",size:"sm",leftIcon:Y.copy,onClick:()=>Dn.copyUrl(e.id),children:Ae.copyUrl})]}),an&&Re&&/* @__PURE__ */R("div",{className:"flex flex-wrap gap-2",children:[ze&&/* @__PURE__ */Q(z,{variant:"secondary",size:"sm",leftIcon:Y.swap,onClick:()=>ze(e.id),...Zn(fe.replace),children:Ae.replace}),Fe&&/* @__PURE__ */Q(z,{variant:"secondary",size:"sm",leftIcon:Y.crop,onClick:()=>Fe(e.id),children:Ae.cropEdit}),Ce&&"submenu"===i?.type&&/* @__PURE__ */Q(h,{align:"start",triggerClassName:vl,trigger:/* @__PURE__ */R(K,{children:[Y.folder,Ae.moveTo]}),items:i.items,disabled:!!fe.move}),xe&&/* @__PURE__ */Q(z,{variant:"secondary",size:"sm",leftIcon:Y.edit,onClick:()=>yn({kind:"file",id:e.id}),...Zn(fe.rename),children:Ae.rename}),Ne&&/* @__PURE__ */Q(I,{"aria-label":Ae.moveToTrash,size:"sm",onClick:()=>Ne({kind:"files",ids:[e.id]}),disabledReason:fe.trash,"aria-disabled":!!fe.trash||void 0,children:Y.trash})]}),ln&&Re&&/* @__PURE__ */R("div",{className:"flex flex-wrap gap-2",children:[De&&/* @__PURE__ */Q(z,{variant:"primary",size:"sm",leftIcon:Y.undo,onClick:()=>De([e.id]),...Zn(fe.restore),children:Ae.restore}),Se&&/* @__PURE__ */Q(z,{variant:"danger",size:"sm",onClick:()=>Se([e.id]),...Zn(fe.deleteForever),children:Ae.deleteForever})]}),nn&&Oe&&/* @__PURE__ */Q(z,{variant:"secondary",size:"sm",leftIcon:Y.external,onClick:()=>Oe({kind:"render",id:e.id}),children:Ae.openInDesign}),he&&/* @__PURE__ */Q(k,{items:he})]})},wl=mn?mn.private?Ae.privateNoPick:mn.pickDisabledReason:void 0,xl=Be?/* @__PURE__ */R("div",{"data-media-picker-footer":"",className:"flex flex-wrap items-center justify-between gap-2 border-t border-line px-3 py-2",children:[
|
|
19
|
+
/* @__PURE__ */Q("span",{className:"min-w-0 truncate text-sm text-ink-faint",children:mn?Ae.oneChosen(mn.name):Ae.noneChosen}),
|
|
20
|
+
/* @__PURE__ */R("div",{className:"flex gap-2",children:[Le&&/* @__PURE__ */Q(z,{variant:"secondary",size:"sm",onClick:Le,children:Ae.cancel}),
|
|
21
|
+
/* @__PURE__ */Q(z,{variant:"primary",size:"sm",disabled:!mn,...Zn(wl),onClick:()=>{mn&&!wl&&Te?.(mn)},children:Ae.chooseImage})]})]}):null,Cl=Re&&!!mn,Nl=/* @__PURE__ */R("div",{className:"flex min-w-0 flex-col gap-3",children:[Pe&&/* @__PURE__ */Q(C,{tone:"neutral",children:Pe}),
|
|
22
|
+
/* @__PURE__ */R("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[
|
|
23
|
+
/* @__PURE__ */Q(d,{items:Wn}),_n]}),ll,yl,
|
|
24
|
+
/* @__PURE__ */R("div",{ref:cl,className:"relative",onPointerDown:ul.onPointerDown,onKeyDown:e=>{Re&&(e.ctrlKey||e.metaKey)&&"a"===e.key.toLowerCase()?(e.preventDefault(),cn.selectAll()):"Escape"===e.key&&cn.size&&cn.clear()},children:[fl,
|
|
25
|
+
/* @__PURE__ */Q(a,{rect:ul.rect})]}),$n&&/* @__PURE__ */Q("input",{...Hn.inputProps}),
|
|
26
|
+
/* @__PURE__ */Q(S,{rejections:Hn.rejections})]});/* @__PURE__ */
|
|
27
|
+
return R("div",{ref:Ke,"data-media-library":"","data-layout":Ve?"phone":"wide",className:`flex h-full min-h-0 min-w-0 flex-col ${Me}`.trim(),children:[/* @__PURE__ */R("div",Ve?{className:"flex flex-col gap-3 p-3",children:[Jn,Nl]}:{className:"flex min-h-0 min-w-0 flex-1",children:[
|
|
28
|
+
/* @__PURE__ */Q("div",{className:"shrink-0 overflow-y-auto border-r border-line p-3",style:{width:280,"--rosh-tree-ground":"var(--surface)"},children:Jn}),
|
|
29
|
+
/* @__PURE__ */Q("div",{className:"min-w-0 flex-1 overflow-y-auto p-3",children:Nl}),Cl&&/* @__PURE__ */Q("div",{className:"shrink-0 overflow-y-auto border-l border-line p-3",style:{width:300},children:bl(mn)})]}),xl,Ve&&/* @__PURE__ */Q(o,{open:Cl,onClose:cn.clear,side:"bottom",title:mn?.name,children:mn&&bl(mn)}),jn.state&&/* @__PURE__ */Q(x,{...jn.props,items:Sn(jn.state.data)}),null!=Nn&&ie.length>0&&/* @__PURE__ */Q(r,{images:ie.map(e=>({url:e.url,caption:e.name})),startIndex:Math.min(Nn,ie.length-1),onClose:()=>In(null)})]})}export{V as MEDIA_FILES_DRAG_TYPE,X as MEDIA_FILE_DRAG_TYPE,G as MEDIA_FOLDER_DRAG_TYPE,q as MediaLibrary,J as readMediaFileDrag};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{ImageFocusPoint as e}from"./chunk-XQZL6JDD.js";import{FormField as a}from"./chunk-6KBDNYRW.js";import{Segmented as i}from"./chunk-3ELLBQPS.js";import{isVideoUrl as t,mediaPromptLine as o,mediaFileName as r,FilenameBadge as n,BusyOverlay as l,UploadGlyph as s,dropzoneClass as c,zoneFocusClass as d}from"./chunk-Z5A4EY2R.js";import{TransferProgress as u}from"./chunk-DHIQ46C5.js";import{useFileIntake as m,FileIntakeAlert as h}from"./chunk-JTMEFXRL.js";import{Icon as p}from"./chunk-2UO47XB4.js";import{useShellStrings as b}from"./chunk-GDQJBQ5B.js";import{useState as g,useRef as v,useEffect as f,useId as y}from"react";import{jsxs as k,jsx as j,Fragment as x}from"react/jsx-runtime";var N=["flex h-8 items-center justify-center rounded-(--radius-control) text-(--status-on-solid)","not-disabled:hover:bg-white/10 disabled:cursor-not-allowed disabled:opacity-60","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]"].join(" ");function L({value:L,onChange:w,onPick:R,onFile:C,label:F,hint:U,error:B,required:O,className:P,accept:$="image/*",maxSizeBytes:z,fit:D="cover",height:Q=112,placeholder:H,cta:q,acceptHint:E,showFilename:I=!0,allowReplace:J=!0,allowRemove:S=!0,replaceLabel:X,removeLabel:A,busy:K=!1,busyLabel:W,choosingLabel:Y,pickFailedLabel:Z,progress:_,disabled:G=!1,kind:M,onKindChange:T,focus:V,onFocusChange:ee,focusLabel:ae}){const ie=b().media,te=q??ie.cta,oe=M??(/video/.test($)&&!/image/.test($)?"video":"image"),re="string"==typeof A&&A?A:ie.remove,[ne,le]=g(!1),[se,ce]=g(!1),de=v(!0);f(()=>()=>{de.current=!1},[]);const ue=K||ne,me=ne&&!K?Y??ie.choosing:W??ie.uploading,he=B??(se?Z??ie.pickFailed:void 0),pe=e=>{if(!R)return;ce(!1);const a=R(e);a&&"function"==typeof a.then&&(le(!0),a.then(e=>{de.current&&(le(!1),"string"==typeof e&&e&&w(e))},()=>{de.current&&(le(!1),ce(!0))}))},be=y(),ge=v(null),[ve,fe]=g(null);f(()=>()=>{ge.current&&URL.revokeObjectURL(ge.current)},[]);const ye=G||ue,ke=!!L&&(t(L,$)||L===ve),je=H??o($,ie),xe=X??(ke||"video"===oe?ie.changeVideo:ie.changeImage),Ne=e=>{R?pe(e):C?C(e):(e=>{ge.current&&URL.revokeObjectURL(ge.current);const a=URL.createObjectURL(e);ge.current=a,fe(e.type.startsWith("video/")?a:null),w(a)})(e)},Le=m({accept:$,maxSizeBytes:z,acceptHint:E,multiple:!1,disabled:ye,onAccept:([e])=>Ne(e)}),{dragOver:we}=Le,Re=()=>{ye||(R?pe():Le.open())},Ce=L?r(L):"",Fe=!ke&&!!ee,Ue=G||!J&&!S?null:/* @__PURE__ */k("div",{"data-media-bar":"",className:["absolute inset-x-0 bottom-0 flex items-center gap-1 p-1 text-(--status-on-solid)","opacity-0 transition-opacity duration-(--motion-fast)","group-hover/media:opacity-100 group-focus-within/media:opacity-100 [@media(hover:none)]:opacity-100"].join(" "),style:{background:"var(--rosh-media-scrim-button)"},children:[J&&/* @__PURE__ */k("button",{id:Fe?void 0:be,type:"button","aria-labelledby":`${be}-change`,onClick:()=>Re(),disabled:ue,className:`min-w-0 flex-1 gap-1 px-2 text-sm font-medium ${N}`,children:[
|
|
2
|
+
/* @__PURE__ */j(p,{name:"swap","aria-hidden":"true",className:"h-4 w-4 shrink-0"}),
|
|
3
|
+
/* @__PURE__ */j("span",{id:`${be}-change`,className:"truncate",children:xe})]}),S&&/* @__PURE__ */j("button",{type:"button","aria-label":re,onClick:()=>{ge.current&&(URL.revokeObjectURL(ge.current),ge.current=null),fe(null),w("")},disabled:ue,className:`ml-auto w-8 shrink-0 ${N}`,children:/* @__PURE__ */j(p,{name:"trash","aria-hidden":"true",className:"h-4 w-4"})})]}),Be=/* @__PURE__ */k("div",{...Le.zoneProps,"data-media-frame":"",className:["group/media relative overflow-hidden rounded-(--radius-control) border transition-colors",Fe?"":"bg-gray-100",we?"border-blue-500":"border-line"].join(" "),style:Fe?void 0:{height:Q},children:[Fe?
|
|
4
|
+
/* @__PURE__ */j(e,{value:V??"",onChange:e=>ee?.(e),label:ae??ie.focus,image:L,hint:null,id:be,disabled:ye,className:"[&_[data-image-focus-picture]]:rounded-none [&_[data-image-focus-picture]]:border-0"}):ke?/* @__PURE__ */j("video",{src:L??void 0,muted:!0,playsInline:!0,preload:"metadata","aria-label":Ce||void 0,className:"h-full w-full",style:{objectFit:D}}):/* @__PURE__ */j("img",{src:L??void 0,alt:Ce,className:"h-full w-full",style:{objectFit:D,objectPosition:V||void 0}}),I&&L&&/* @__PURE__ */j(n,{children:Ce}),Ue,ue&&/* @__PURE__ */j(l,{label:me,progress:_,rounded:"rounded-md"})]}),Oe=/* @__PURE__ */j("button",{type:"button",id:be,onClick:()=>Re(),disabled:ye,"aria-label":"string"==typeof je?je:ie.upload,"aria-busy":ue||void 0,"aria-invalid":!!he||void 0,"aria-required":O||void 0,"aria-describedby":he?`${be}-error`:U?`${be}-hint`:void 0,...Le.zoneProps,className:c(we,ye,d(ye)),style:{minHeight:Q},children:ue?/* @__PURE__ */j(u,{state:"busy",verb:me,pct:_}):/* @__PURE__ */k(x,{children:[
|
|
5
|
+
/* @__PURE__ */j("span",{className:"text-ink-faintest",children:/* @__PURE__ */j(s,{})}),
|
|
6
|
+
/* @__PURE__ */j("span",{className:"px-3 text-xs text-ink-faint",children:je}),
|
|
7
|
+
/* @__PURE__ */j("span",{className:"text-sm font-medium text-blue-600",children:te}),E&&/* @__PURE__ */j("span",{className:"text-xs text-ink-faintest",children:E})]})});/* @__PURE__ */
|
|
8
|
+
return k(a,{label:F,htmlFor:be,hint:U,error:he,required:O,className:P,children:[T&&/* @__PURE__ */j("div",{"data-media-kind":"",className:"mb-2",children:/* @__PURE__ */j(i,{value:oe,onChange:e=>T(e),options:[{value:"image",label:ie.image,icon:/* @__PURE__ */j(p,{name:"image","aria-hidden":"true",className:"h-4 w-4"}),disabled:ye},{value:"video",label:ie.video,icon:/* @__PURE__ */j(p,{name:"play","aria-hidden":"true",className:"h-4 w-4"}),disabled:ye}],block:!0,size:"md",label:"string"==typeof F&&F?F:ie.upload})}),L?Be:Oe,!R&&/* @__PURE__ */j("input",{...Le.inputProps}),
|
|
9
|
+
/* @__PURE__ */j(h,{rejections:Le.rejections})]})}export{L as MediaUploadField};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Modal as e}from"./chunk-
|
|
1
|
+
import{Modal as e}from"./chunk-2YSGXZOL.js";import{keepsNativeMenu as a}from"./chunk-5QFPTDQF.js";import{jsx as i,jsxs as n}from"react/jsx-runtime";var t={activeOpacity:70,inactiveOpacity:50,activeBlur:0,inactiveBlur:0};function r(e){try{const a=JSON.parse(localStorage.getItem(e)||"");return null!=a.blur&&null==a.activeBlur&&(a.activeBlur=a.blur,a.inactiveBlur=a.blur,delete a.blur),{...t,...a}}catch{return t}}function l({open:t,onClose:r,title:l,appearance:c,onAppearanceChange:s,onSave:d,children:o}){if(!t)return null;const u="w-full h-1.5 rounded-full appearance-none bg-gray-200 cursor-pointer accent-blue-500",p="flex items-center justify-between text-xs text-gray-500";/* @__PURE__ */
|
|
2
2
|
return i("div",{onPointerDown:e=>e.stopPropagation(),onContextMenu:e=>{e.stopPropagation(),a(e.target)||e.preventDefault()},children:/* @__PURE__ */i(e,{open:t,onClose:r,title:l,size:"sm",children:/* @__PURE__ */n("div",{className:"space-y-4",children:[o,
|
|
3
3
|
/* @__PURE__ */n("div",{children:[
|
|
4
4
|
/* @__PURE__ */i("h3",{className:"text-sm font-semibold text-gray-700 mb-3",children:"Appearance"}),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{InputNumber_default as e}from"./chunk-
|
|
2
|
-
return c(y.Provider,{value:r,children:e})}function g({value:r,onChange:a,min:w,max:g,step:S=1,shiftStep:z,precision:F,inputMin:k,inputMax:N,suffix:
|
|
3
|
-
/* @__PURE__ */c("input",{id:
|
|
4
|
-
/* @__PURE__ */c("div",{ref:_,"data-slider-box":"",className:"shrink-0 text-xs",style:{width:ae?.width??le,...ee?{fontSize:ee.fontSize}:{}},children:/* @__PURE__ */c(e,{value:r,onChange:e=>{null!=e?e<
|
|
1
|
+
import{InputNumber_default as e}from"./chunk-5SIOCKCK.js";import{useSettingAuto as t}from"./chunk-2NMW66P5.js";import{useBrowserLayoutEffect as i}from"./chunk-D65T4H6J.js";import{useShellStrings as n}from"./chunk-GDQJBQ5B.js";import{createContext as r,useState as l,useMemo as a,useId as o,useRef as d,useContext as u,useEffect as s}from"react";import{jsx as c,jsxs as m}from"react/jsx-runtime";var f=(e,t,i)=>Math.min(i,Math.max(t,e));function p(e){const t=String(e),i=/e-(\d+)$/.exec(t);return i?Number(i[1]):t.split(".")[1]?.length??0}var h=8,v=40;function x(e){return Math.max(1,...e.map(e=>(e??"").length))}function b(e,t,i,n){return Number(f(e,t,i).toFixed(n))}var y=r(null);function w({children:e}){const[t,i]=l({}),n=a(()=>(e,t)=>i(i=>{if(null===t){if(!(e in i))return i;const t={...i};return delete t[e],t}return i[e]===t?i:{...i,[e]:t}}),[]),r=a(()=>{const e=Object.values(t);return{set:n,width:e.length?`max(${e.join(", ")})`:null}},[t,n]);/* @__PURE__ */
|
|
2
|
+
return c(y.Provider,{value:r,children:e})}function g({value:r,onChange:a,min:w,max:g,step:S=1,shiftStep:z,precision:F,inputMin:k,inputMax:N,suffix:j,showInput:K=!0,emptyLabel:$,placeholderValue:C,stepFrom:L,label:M,"aria-labelledby":D,valueText:A,id:B,disabled:E,size:R="md",boxSize:W="sm",className:I="",auto:J}){const O=n(),P=o(),Q=t(),T=J??Q,V=o(),q=B??P,G=F??p(S),H=k??w,U=N??g,X=void 0!==$||void 0!==C,Y=L??C,Z=f(r??C??w,w,g),_=d(null),[ee,te]=l(null),ie=Boolean(j);i(()=>{const e=()=>{const e=_.current?.querySelector("input");if(!e)return;const t=getComputedStyle(e),i=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"].reduce((e,i)=>e+(parseFloat(t[i])||0),0);i<=0||te(e=>e&&e.frame===i&&e.fontSize===t.fontSize?e:{frame:i,fontSize:t.fontSize})};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[ie,K]);const ne=e=>A?A(e):"string"==typeof j?`${e.toFixed(G)} ${j}`:void 0,re=null==r?$??(null!=C?ne(C)??String(C):void 0):ne(r),le=`calc(${x([w.toFixed(G),g.toFixed(G),r?.toFixed(G),$,C?.toFixed(G)])}ch + ${(ee?.frame??10+(ie?v:h))+2}px)`,ae=u(y),oe=o(),de=ae?.set;return i(()=>{de&&de(oe,K?le:null)},[de,oe,le,K]),s(()=>()=>de?.(oe,null),[de,oe]),/* @__PURE__ */m("div",{"data-slider":"",className:`flex w-full min-w-0 items-center gap-3 ${I}`.trim(),children:[
|
|
3
|
+
/* @__PURE__ */c("input",{id:q,type:"range",min:w,max:g,step:S,value:Z,disabled:E,"aria-label":D?void 0:M,"aria-labelledby":D,"aria-valuetext":re,"aria-describedby":T?V:void 0,onKeyDown:e=>{const t="ArrowUp"===e.key||"ArrowRight"===e.key?1:"ArrowDown"===e.key||"ArrowLeft"===e.key?-1:0;if(!t||e.altKey||e.ctrlKey||e.metaKey)return;const i=e.shiftKey&&null!=z;if(!i&&!(null==r&&null!=Y))return;e.preventDefault();a(b((r??Y??Z)+t*(i?z??S:S),w,g,G))},onChange:e=>a(b(Number(e.target.value),w,g,G)),className:"min-w-24 flex-1 cursor-pointer accent-blue-600 disabled:cursor-not-allowed disabled:opacity-60 "+("sm"===R?"h-1":"h-1.5")}),K&&
|
|
4
|
+
/* @__PURE__ */c("div",{ref:_,"data-slider-box":"",className:"shrink-0 text-xs",style:{width:ae?.width??le,...ee?{fontSize:ee.fontSize}:{}},children:/* @__PURE__ */c(e,{value:r,onChange:e=>{null!=e?e<H||e>U||a(e):X&&a(null)},min:H,max:U,step:S,shiftStep:z,stepFrom:Y,precision:G,snap:!0,allowEmpty:X,suffix:j,disabled:E,placeholder:$??(null!=C?C.toFixed(G):void 0),size:W,auto:T,"aria-label":M?O.slider.value(M):void 0,"aria-labelledby":M?void 0:D})}),T&&/* @__PURE__ */c("span",{id:V,hidden:!0,children:O.settingView.auto})]})}export{g as Slider,w as SliderGroup,b as settleSliderValue,x as sliderBoxChars,p as stepDecimals};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{GROUP_COLORS as e}from"./chunk-TXDA7TTP.js";import{SpinnerRing as r}from"./chunk-R2VKEMZH.js";import{Tooltip as n}from"./chunk-6XBWM453.js";import{useShellStrings as l}from"./chunk-
|
|
1
|
+
import{GROUP_COLORS as e}from"./chunk-TXDA7TTP.js";import{SpinnerRing as r}from"./chunk-R2VKEMZH.js";import{Tooltip as n}from"./chunk-6XBWM453.js";import{useShellStrings as l}from"./chunk-GDQJBQ5B.js";import{jsx as t,jsxs as i,Fragment as a}from"react/jsx-runtime";var s="inline-flex items-center gap-1 whitespace-nowrap rounded-md border border-current/20 py-0.5 pl-2 pr-1 text-2xs font-medium";function o({label:e,glyph:r,onClick:l}){/* @__PURE__ */
|
|
2
2
|
return t(n,{content:e,describe:!1,children:/* @__PURE__ */t("button",{type:"button",onClick:l,"aria-label":e,className:"flex h-4 w-4 items-center justify-center rounded-full leading-none hover:bg-current/10 rosh-focus-ring focus-visible:ring-2",children:/* @__PURE__ */t("span",{"aria-hidden":"true",children:r})})})}function c({state:n,label:c,verb:u,subject:m,pct:p,onCancel:d,onRetry:h,onDismiss:f,className:b=""}){const g=l().transfer;if("idle"===n)return null==c?null:/* @__PURE__ */t("span",{className:`${s} ${e.neutral} pr-2 ${b}`.trim(),children:c});if("error"===n)/* @__PURE__ */
|
|
3
3
|
return i("span",{role:"status",className:`${s} ${e.danger} ${b}`.trim(),children:[
|
|
4
4
|
/* @__PURE__ */t("span",{children:g.error}),h&&/* @__PURE__ */t(o,{label:g.retry,glyph:"↻",onClick:h}),f&&/* @__PURE__ */t(o,{label:g.dismiss,glyph:"×",onClick:f})]});const y=u??g.uploading,$=null==p||Number.isNaN(p)?null:Math.max(0,Math.min(100,Math.round(p))),k="string"==typeof y?g.cancelVerb(y.toLowerCase()):g.cancel,N=e=>[e,m,null==$?"":`${$}%`].filter(Boolean).join(" ");/* @__PURE__ */
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{warnOnce as a,resolveSeverity as e,styleForTone as t,severityOf as l,boundOf as n}from"./chunk-TZFNWAED.js";import{TICK_INK as i}from"./chunk-URBCGEXG.js";import{useShellStrings as r,useShellLocale as s}from"./chunk-
|
|
2
|
-
return o("div",{title:e,className:`absolute -top-[3px] h-3 w-0.5 rounded-[1px] ${t}`,style:{left:`${a}%`}})}var x=a=>Math.min(100,Math.max(0,a));function h({label:h,value:p,max:f=100,warn:g,crit:b,severity:v,detail:N,formatValue:y,emptyLabel:w,size:k="sm",ariaLabel:$,className:M=""}){const
|
|
3
|
-
/* @__PURE__ */o("div",{className:`absolute inset-y-0 left-0 rounded-full ${
|
|
1
|
+
import{warnOnce as a,resolveSeverity as e,styleForTone as t,severityOf as l,boundOf as n}from"./chunk-TZFNWAED.js";import{TICK_INK as i}from"./chunk-URBCGEXG.js";import{useShellStrings as r,useShellLocale as s}from"./chunk-GDQJBQ5B.js";import{formatPercent as u,formatPlain as m}from"./chunk-C3QOHMR6.js";import{jsxs as c,jsx as o}from"react/jsx-runtime";function d({at:a,title:e,className:t}){/* @__PURE__ */
|
|
2
|
+
return o("div",{title:e,className:`absolute -top-[3px] h-3 w-0.5 rounded-[1px] ${t}`,style:{left:`${a}%`}})}var x=a=>Math.min(100,Math.max(0,a));function h({label:h,value:p,max:f=100,warn:g,crit:b,severity:v,detail:N,formatValue:y,emptyLabel:w,size:k="sm",ariaLabel:$,className:M=""}){const B=r().meter,j=s(),A=w??B.noData,D=null!=p&&Number.isFinite(p)?p:null,F=Number.isFinite(f)&&f>0?f:null;null==F&&a(`MetricBar:max:${String(f)}`,`[efficient-shell] MetricBar: max=${String(f)} is not a positive finite number, so there is no scale to draw a proportional bar against. Printing the value without a bar. Pass the real capacity, or leave the reading out entirely (value={null}) when it is unknown — do not pass 0.`);const G=e(v,"MetricBar"),Q=null!=D?G??t(l(D,g,b)):null,C=n(g),E=n(b),L=null!=D&&null!=F?x(D/F*100):0,P=null!=D?(y??(a=>100===F?u(a,1,j):m(a,j)))(D):"—",R=null!=D&&null!=F&&(null!=C||null!=E),S="md"===k||"lg"===k,z=S?"h-2":"h-1.5",H=null!=D&&null!=F,J=/* @__PURE__ */c("div",{...H?{role:"meter","aria-label":$??("string"==typeof h?h:void 0),"aria-valuemin":0,"aria-valuemax":F,"aria-valuenow":Math.min(F,Math.max(0,D)),"aria-valuetext":P}:{"aria-hidden":!0},className:H&&Q?`relative mt-2 ${z} rounded-full bg-gray-200`:`relative mt-2 ${z} rounded-full border border-dashed border-gray-300 bg-transparent`,children:[H&&
|
|
3
|
+
/* @__PURE__ */o("div",{className:`absolute inset-y-0 left-0 rounded-full ${Q?Q.fill:"bg-gray-400"}`,style:{width:`${L}%`}}),R&&null!=F&&null!=C&&/* @__PURE__ */o(d,{at:x(C/F*100),title:B.warningAt(C),className:i.warning}),R&&null!=F&&null!=E&&/* @__PURE__ */o(d,{at:x(E/F*100),title:B.criticalAt(E),className:i.critical})]}),O=Q?Q.ink:null!=D?"text-gray-900":"text-gray-400";if(S){const a="lg"===k;/* @__PURE__ */
|
|
4
4
|
return c("div",{className:M,children:[null!=h&&/* @__PURE__ */o("div",{className:(a?"text-xs":"text-3xs")+" font-medium uppercase tracking-wide text-gray-500",children:h}),
|
|
5
5
|
/* @__PURE__ */c("div",{className:"mt-1 flex items-baseline gap-2",children:[
|
|
6
|
-
/* @__PURE__ */o("span",{className:`text-2xl font-semibold leading-[30px] tabular-nums ${
|
|
7
|
-
/* @__PURE__ */o("span",{className:"min-w-0 truncate tabular-nums "+(a?"text-xs text-gray-500":"text-2xs text-gray-400"),children:null!=
|
|
6
|
+
/* @__PURE__ */o("span",{className:`text-2xl font-semibold leading-[30px] tabular-nums ${O}`,children:P}),
|
|
7
|
+
/* @__PURE__ */o("span",{className:"min-w-0 truncate tabular-nums "+(a?"text-xs text-gray-500":"text-2xs text-gray-400"),children:null!=D?N:A})]}),J]})}/* @__PURE__ */
|
|
8
8
|
return c("div",{className:M,children:[
|
|
9
9
|
/* @__PURE__ */c("div",{className:"flex items-baseline gap-2",children:[null!=h&&/* @__PURE__ */o("span",{className:"w-14 shrink-0 truncate text-3xs font-medium uppercase tracking-wide text-ink-faint",children:h}),
|
|
10
|
-
/* @__PURE__ */o("span",{className:`text-sm font-semibold tabular-nums ${
|
|
11
|
-
/* @__PURE__ */o("span",{className:"ml-auto min-w-0 truncate text-2xs tabular-nums text-ink-faintest",children:null!=
|
|
10
|
+
/* @__PURE__ */o("span",{className:`text-sm font-semibold tabular-nums ${O}`,children:P}),
|
|
11
|
+
/* @__PURE__ */o("span",{className:"ml-auto min-w-0 truncate text-2xs tabular-nums text-ink-faintest",children:null!=D?N:A})]}),J]})}export{h as MetricBar};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{ChartTooltip as e}from"./chunk-G4GVLK44.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-GDQJBQ5B.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:D=[4,22],className:L,emptyLabel:S}){const U=m().charts,B=h(),P=z??(e=>f(e,B)),Q=$??(e=>f(e,B)),V=S??U.noObservations,W=u(null),C=n(W),E=v??C,G=p(),[O,F]=d(null);x(()=>{if(null!==O)return c(e=>"Escape"===e.key&&(F(null),!0))},[O]);const I=(e,t)=>!t||e>=Math.min(t[0],t[1])&&e<=Math.max(t[0],t[1]),J=b.map((e,t)=>({...e,slot:t})).filter(e=>e.points.length>0),K=j||w?J.map(e=>({...e,points:e.points.filter(e=>I(e.x,j)&&I(e.y,w))})).filter(e=>e.points.length>0):J,T=J.reduce((e,t)=>e+t.points.length,0)-K.reduce((e,t)=>e+t.points.length,0);if(0===K.length)/* @__PURE__ */
|
|
2
|
+
return y("div",{className:L,ref:W,children:/* @__PURE__ */y("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:k},children:V})});const X=K.flatMap(e=>e.points),Z=X.some(e=>null!=e.size),H=14,Y=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(X.map(e=>e.y),w,R,{from:k-q,to:H}),ie=t(te.ticks(5).map(Q),_),le=Math.max(ie+1,E-Y),re=ee(X.map(e=>e.x),j,N,{from:ie,to:le}),oe=i([0,Math.max(...X.map(e=>e.size??1))],{from:D[0],to:D[1]}),ne=O?K[O.s]:void 0,ae=O&&ne?ne.points[O.i]:void 0,se=K.flatMap((e,t)=>e.points.map((e,i)=>({s:t,i:i})));/* @__PURE__ */
|
|
3
|
+
return g("div",{className:`relative ${L??""}`,ref:W,children:[
|
|
4
|
+
/* @__PURE__ */g("svg",{width:"100%",height:k,viewBox:`0 0 ${E} ${k}`,role:"img","aria-label":U.scatter(K.map(e=>e.label),A??U.yAxis,M??U.xAxis)+(T>0?`. ${U.outsideRange(T)}`:""),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:G,children:/* @__PURE__ */y("rect",{x:ie-D[1],y:H-D[1],width:le-ie+2*D[1],height:k-q-H+2*D[1]})})}),te.ticks(5).map(e=>/* @__PURE__ */g("g",{children:[
|
|
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:Q(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:P(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(#${G})`,children:K.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):D[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??U.xAxis,color:s(ne.slot,3,ne.color,ne.tone),value:P(ae.x)},{key:"y",label:A??U.yAxis,color:s(ne.slot,3,ne.color,ne.tone),value:Q(ae.y)},...null!=ae.size?[{key:"size",label:U.size,color:a.muted,value:f(ae.size,B)}]:[]],footnote:ae.label?ne.label:void 0})})]})}export{b as SCATTER_SERIES_CAP,k as ScatterChart};
|
|
@@ -1,5 +1,5 @@
|
|
|
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-GDQJBQ5B.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
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}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useShellStrings as t}from"./chunk-
|
|
1
|
+
import{useShellStrings as t}from"./chunk-GDQJBQ5B.js";import{useRef as e,useEffect as r,useCallback as n}from"react";function i({open:i,dirty:o,onClose:c,title:s,layer:u}){const a=t().dialog,d=e(!1),l=e(!1),m=e({dirty:o,onClose:c,title:s,strings:a});return r(()=>{m.current={dirty:o,onClose:c,title:s,strings:a}}),r(()=>{i||(d.current=!1)},[i]),r(()=>{if(!i||"auto"!==o||!u)return;const t=t=>{u.contains(t.target)&&(d.current=!0)};return document.addEventListener("input",t,!0),document.addEventListener("change",t,!0),()=>{document.removeEventListener("input",t,!0),document.removeEventListener("change",t,!0)}},[i,o,u]),n(()=>{const{dirty:t,onClose:e,title:r,strings:n}=m.current;if(l.current)return;("auto"===t?d.current:t)?(l.current=!0,import("./shell/ConfirmDialog.js").then(({confirm:t})=>t({title:n.discardTitle,message:n.discardMessage("string"==typeof r?r:void 0),confirmLabel:n.discardConfirm,cancelLabel:n.keepEditing,variant:"warning"})).then(t=>{l.current=!1,t&&(d.current=!1,m.current.onClose())})):e()},[])}export{i as useDiscardGuard};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import{ChartBrush as t}from"./chunk-E6GDAV5R.js";import{ChartDot as e}from"./chunk-CK2YOGUS.js";import{stepPath as a,curvePath as r,areaBetween as o,areaFrom as l}from"./chunk-VFC6QUEN.js";import{ChartDefs as n,MOTION as i,stagger as s,fillFor as c,dashFor as d,maskId as m}from"./chunk-465RRWBY.js";import{ChartSkeleton as h}from"./chunk-3IUPYCW3.js";import{useHighlight as u,highlightOpacity as f}from"./chunk-CNYAHYE6.js";import{ChartTooltip as p}from"./chunk-G4GVLK44.js";import{useDragZoom as g,DragBand as y,ChartZoomSummary as k,tooltipBesideBand as x}from"./chunk-C764JODK.js";import{pairedAxes as v,niceAxis as b,niceMax as M,linearScale as N,axisGutter as w,bandScale as j,ladderScale as $}from"./chunk-2JWPNR2U.js";import{usePlotWidth as V}from"./chunk-MAFUXCPZ.js";import{resolveSeriesColor as z,CHART_INK as A,STATUS_VARS as C}from"./chunk-TZFACUMR.js";import{registerModalEscapeInterceptor as D}from"./chunk-TWVUQUUD.js";import{useShellStrings as L,useShellLocale as R}from"./chunk-GDQJBQ5B.js";import{formatPercent as W,formatPlain as E}from"./chunk-C3QOHMR6.js";import{useRef as S,useState as U,useId as T,useEffect as I}from"react";import{jsx as P,jsxs as B}from"react/jsx-runtime";var O=12,F=16,G=26,Q=52,Y=t=>"number"==typeof t&&Number.isFinite(t);function K({series:K,labels:J,height:H=200,stacked:Z=!1,stackMode:X="value",levels:q,curve:_="linear",tension:tt=0,max:et,yTickCount:at=4,formatValue:rt,formatTooltipValue:ot,tooltipLabels:lt,yAxisLabel:nt,referenceLines:it,labelEndpoints:st=!1,dots:ct,dotVariant:dt="border",pulse:mt=!1,brush:ht=!1,range:ut,onRangeChange:ft,zoomable:pt=!0,columnStrip:gt,onSelect:yt,loading:kt=!1,animate:xt=!0,reveal:vt="left-to-right",fillVariant:bt="gradient",gridStyle:Mt="solid",width:Nt,className:wt,emptyLabel:jt}){const $t=L().charts,Vt=R(),zt=rt??(t=>E(t,Vt)),At=ot??zt,Ct=jt??$t.noData,Dt=S(null),Lt=V(Dt),Rt=Nt??Lt,[Wt,Et]=U(null),[St,Ut]=U(null),{highlighted:Tt}=u(),It=T(),Pt=ut??St,Bt=g(ht&&Pt?Pt[1]-Pt[0]+1:J.length,pt);if(I(()=>{if(null!==Wt)return D(t=>"Escape"===t.key&&(Et(null),!0))},[Wt]),kt)/* @__PURE__ */
|
|
2
|
+
return P("div",{className:wt,ref:Dt,children:/* @__PURE__ */P(h,{height:H,width:Nt??Lt})});const Ot=J,Ft=ut??St??[0,Math.max(0,Ot.length-1)],[Gt,Qt]=Ft,Yt=t=>Bt.slice(ht?t.slice(Gt,Qt+1):t),Kt=lt?Yt(lt):void 0,Jt=K.map((t,e)=>({...t,slot:e})).filter(t=>t.data.some(Y)).map(t=>({...t,data:Yt(t.data),pointTones:t.pointTones?Yt(t.pointTones):void 0})),Ht=t=>(ht?Gt:0)+(Bt.view?.[0]??0)+t;if(J=Yt(Ot),0===Jt.length||0===J.length)/* @__PURE__ */
|
|
3
|
+
return P("div",{className:wt,ref:Dt,children:/* @__PURE__ */P("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:H},children:Ct})});const Zt=J.map((t,e)=>Jt.reduce((t,a)=>t+(Y(a.data[e])?a.data[e]:0),0)),Xt=(t,e)=>Zt[e]>0?t/Zt[e]:null,qt=[];if(Z){let t=J.map(()=>0);for(const e of Jt)t=t.map((t,a)=>t+(Y(e.data[a])?e.data[a]:0)),qt.push("percent"===X?t.map((t,e)=>Xt(t,e)):[...t])}const _t=!!q&&q.length>0,te=t=>"right"===t.axis,ee=!Z&&!_t&&void 0===et&&Jt.some(te)&&Jt.some(t=>!te(t)),ae=gt&&!Z?gt:null,re=t=>!!ae&&"column"===t.mode,oe=(ee?Jt.filter(t=>!te(t)):Jt).filter(t=>!re(t)),le=ee?Jt.filter(te).flatMap(t=>t.data.filter(Y)):[],ne=Z?(qt.at(-1)??[]).filter(Y):oe.flatMap(t=>t.data.filter(Y)),ie=ee?v([Math.min(0,...ne),Math.max(0,...ne)],[Math.min(0,...le),Math.max(0,...le)],{intervals:at+1,integerLeft:ne.every(Number.isInteger),integerRight:le.every(Number.isInteger)}):null,se=ie?ie.left:Z&&"percent"===X||_t||void 0!==et?null:b(Z?0:Math.min(0,...ne),Math.max(0,...ne),{intervals:at+1,integer:ne.every(Number.isInteger)}),ce=se?se.lo:0,de=Z&&"percent"===X?1:se?se.hi:et??M(Math.max(...ne,0)),me=Z&&"percent"===X?t=>W(Math.round(100*t),0,Vt):zt,he=_t?q:se?se.ticks:N([ce,de],{from:0,to:1}).ticks(at+1),ue=w(he.map(me),Q),fe=ie?w(ie.right.ticks.map(zt),F):F,pe={left:ue,right:Math.max(ue+1,Rt-fe),top:O,bottom:H-G},ge=j(J.length,{from:pe.left,to:pe.right}),ye=_t?$(q,{from:pe.bottom,to:pe.top}):null,ke=N([ce,de],{from:pe.bottom,to:pe.top}),xe=ke(Math.max(ce,0)),ve=t=>ye?ye(t):ke(t),be=Jt.filter(re),Me=Math.max(0,...J.map((t,e)=>be.reduce((t,a)=>t+Math.max(0,Y(a.data[e])?a.data[e]:0),0))),Ne=t=>xe-(Me>0?t/Me:0)*(pe.bottom-pe.top)*(ae??0),we=ie?N([ie.right.lo,ie.right.hi],{from:pe.bottom,to:pe.top}):null,je=t=>we&&te(t)?we:ve,$e=ye?ye.levels.map(t=>({value:t,y:ye(t)})):he.map(t=>({value:t,y:ke(t)})),Ve=t=>e=>{e.preventDefault(),Et(e=>{const a=(e??0)+t;return Math.min(J.length-1,Math.max(0,a))})},ze=Math.max(1,Math.ceil(J.length/Math.max(1,Math.floor(Rt/96))));/* @__PURE__ */
|
|
4
|
+
return B("div",{className:`relative ${wt??""}`,ref:Dt,children:[
|
|
5
|
+
/* @__PURE__ */B("svg",{width:"100%",height:H,viewBox:`0 0 ${Rt} ${H}`,role:"img","aria-label":$t.overIntervals(Jt.map(t=>t.label),J.length),tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>Et(null),onBlur:()=>Et(null),style:pt?{userSelect:"none",touchAction:"pan-y"}:void 0,onKeyDown:t=>{if(yt&&null!==Wt&&("Enter"===t.key||" "===t.key))return t.preventDefault(),void yt(Ht(Wt));"ArrowRight"===t.key&&Ve(1)(t),"ArrowLeft"===t.key&&Ve(-1)(t)},children:[
|
|
6
|
+
/* @__PURE__ */P("defs",{children:/* @__PURE__ */P("clipPath",{id:It,children:/* @__PURE__ */P("rect",{x:pe.left,y:pe.top,width:pe.right-pe.left,height:pe.bottom-pe.top})})}),
|
|
7
|
+
/* @__PURE__ */P(n,{id:It,fills:Jt.map((t,e)=>({color:z(t.slot,t.color,t.tone),variant:t.fillVariant??bt})),fadeFrom:Z?.42:.3,reveal:!!xt&&vt}),$e.map(t=>/* @__PURE__ */P("line",{x1:pe.left,y1:t.y,x2:pe.right,y2:t.y,stroke:A.grid,strokeWidth:1,shapeRendering:"crispEdges",strokeDasharray:"dashed"===Mt?"3 3":void 0},`grid-${t.value}`)),
|
|
8
|
+
/* @__PURE__ */P("line",{x1:pe.left,y1:xe,x2:pe.right,y2:xe,stroke:A.axis,strokeWidth:1,shapeRendering:"crispEdges"}),$e.map(t=>/* @__PURE__ */P("text",{x:pe.left-8,y:t.y+4,textAnchor:"end","data-axis-tick":"true",fontSize:11,fill:A.label,style:{fontVariantNumeric:"tabular-nums"},children:me(t.value)},`ytick-${t.value}`)),ie&&$e.map((t,e)=>/* @__PURE__ */P("text",{x:pe.right+8,y:t.y+4,textAnchor:"start","data-axis-tick":"true",fontSize:11,fill:A.label,style:{fontVariantNumeric:"tabular-nums"},children:zt(ie.right.ticks[e])},`ytick-r-${t.value}`)),nt&&/* @__PURE__ */P("text",{x:12,y:(pe.top+pe.bottom)/2,transform:`rotate(-90 12 ${(pe.top+pe.bottom)/2})`,textAnchor:"middle",fontSize:11,fill:A.label,children:nt}),
|
|
9
|
+
/* @__PURE__ */P("g",{clipPath:`url(#${It})`,mask:xt&&vt?`url(#${m(It)})`:void 0,children:Jt.map((t,e)=>{const n=z(t.slot,t.color,t.tone),m=t.mode??(Z?"area":"line"),h=f(t.key,Tt);if("step"===m){const e=J.map((e,a)=>({start:ge(a),end:ge.end(a),value:t.data[a]})).filter(t=>Y(t.value)).map(e=>({start:e.start,end:e.end,y:je(t)(e.value)}));/* @__PURE__ */
|
|
10
|
+
return P("path",{d:a(e),fill:"none",stroke:n,strokeWidth:2.5,strokeLinecap:"butt",strokeLinejoin:"miter",opacity:h??void 0,className:"rosh-viz-mark"},t.key)}const u=J.map((a,r)=>{const o=Z?qt[e]?.[r]:t.data[r];return Y(o)?[ge.center(r),je(t)(o)]:null}).filter(t=>null!==t);if(0===u.length)return null;if("column"===m){const a=Math.max(1,.62*ge.bandwidth),r="solid"===t.fillVariant,o=je(t);return re(t)?/* @__PURE__ */P("g",{opacity:h??void 0,className:"rosh-viz-mark",children:J.map((o,l)=>{const i=t.data[l];if(!Y(i)||i<=0)return null;const s=((t,e)=>be.slice(0,be.findIndex(e=>e.key===Jt[t]?.key)).reduce((t,a)=>t+Math.max(0,Y(a.data[e])?a.data[e]:0),0))(e,l),c=Ne(s+i),d=Ne(s)-(s>0?1:0);/* @__PURE__ */
|
|
11
|
+
return P("rect",{x:ge.center(l)-a/2,y:c,width:a,height:Math.max(0,d-c),rx:2,fill:t.pointTones?.[l]?C[t.pointTones[l]]:n,fillOpacity:r?1:.55},l)})},t.key):/* @__PURE__ */P("g",{opacity:h??void 0,className:"rosh-viz-mark",children:J.map((l,c)=>{const d=Z?qt[e]?.[c]:t.data[c];if(!Y(d))return null;const m=o(d);/* @__PURE__ */
|
|
12
|
+
return P("rect",{x:ge.center(c)-a/2,y:Math.min(m,xe),width:a,height:Math.abs(xe-m),rx:2,fill:n,fillOpacity:r?1:.35,className:xt?i.rise:void 0,style:xt?s(c,26):void 0},c)})},t.key)}const p=r(u,_,tt),g=Z&&e>0?J.map((t,a)=>[ge.center(a),ve(qt[e-1]?.[a]??0)-2]):null,y=g?o(p,g):l(p,u,xe);/* @__PURE__ */
|
|
13
|
+
return B("g",{opacity:h??void 0,className:"rosh-viz-mark",children:[("area"===m||Z)&&
|
|
14
|
+
/* @__PURE__ */P("path",{d:y,fill:c(It,e,t.fillVariant??bt,n),stroke:"none"}),
|
|
15
|
+
/* @__PURE__ */P("path",{d:p,fill:"none",stroke:n,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",strokeDasharray:d(t.stroke??(t.forecast?"animated-dashed":"solid")),className:xt&&("animated-dashed"===t.stroke||t.forecast&&!t.stroke)?i.march:void 0})]},t.key)})}),it?.map((t,e)=>{const a=t.color??C[t.tone??"critical"],r=ve(t.value);/* @__PURE__ */
|
|
16
|
+
return B("g",{children:[
|
|
17
|
+
/* @__PURE__ */P("line",{x1:pe.left,y1:r,x2:pe.right,y2:r,stroke:a,strokeWidth:1,strokeDasharray:"5 4"}),t.label&&/* @__PURE__ */P("text",{x:pe.right-4,y:r-5,textAnchor:"end",fontSize:11,fontWeight:600,fill:a,children:t.label})]},`rule-${e}`)}),"none"!==(ct??(st?"last":"none"))&&Jt.map((t,a)=>{if("column"===t.mode)return null;const r=ct??(st?"last":"none"),o=z(t.slot,t.color,t.tone),l=[...t.data].map(Y).lastIndexOf(!0),n="all"===r?J.map((t,e)=>e).filter(e=>Y(Z?qt[a]?.[e]:t.data[e])):l>=0?[l]:[];/* @__PURE__ */
|
|
18
|
+
return B("g",{children:[n.map(r=>{const n=Z?qt[a]?.[r]:t.data[r];return Y(n)?/* @__PURE__ */P(e,{cx:ge.center(r),cy:je(t)(n),color:o,variant:dt,pulse:mt&&r===l,title:`${J[r]}: ${t.label} ${zt(n)}`},r):null}),st&&l>=0&&Y(Z?qt[a]?.[l]:t.data[l])&&/* @__PURE__ */P("text",{x:ge.center(l)-10,y:je(t)(Z?qt[a]?.[l]:t.data[l])-9,textAnchor:"end",fontSize:12,fontWeight:600,fill:A.label,style:{fontVariantNumeric:"tabular-nums"},children:zt(Z?qt[a]?.[l]:t.data[l])})]},`dots-${t.key}`)}),J.map((t,e)=>e%ze===0?/* @__PURE__ */P("text",{x:ge.center(e),y:H-8,textAnchor:"middle",fontSize:11,fill:A.label,style:{fontVariantNumeric:"tabular-nums"},children:t},`xtick-${e}`):null),null!==Wt&&/* @__PURE__ */P("line",{x1:ge.center(Wt),y1:pe.top,x2:ge.center(Wt),y2:pe.bottom,stroke:A.axis,strokeWidth:1}),ae&&Me>0&&
|
|
19
|
+
/* @__PURE__ */B("g",{pointerEvents:"none","data-column-strip":"true",children:[
|
|
20
|
+
/* @__PURE__ */P("line",{x1:pe.left,y1:Ne(Me),x2:pe.right,y2:Ne(Me),stroke:A.grid,strokeWidth:1,strokeDasharray:"2 3",shapeRendering:"crispEdges"}),
|
|
21
|
+
/* @__PURE__ */P("text",{x:pe.left+4,y:Ne(Me)-4,fontSize:11,fill:A.label,style:{fontVariantNumeric:"tabular-nums"},children:zt(Me)})]}),Bt.drag&&/* @__PURE__ */P(y,{x0:ge(Bt.drag[0]),x1:ge(Bt.drag[1])+ge.bandwidth,top:pe.top,bottom:pe.bottom}),J.map((t,e)=>/* @__PURE__ */P("rect",{x:ge(e),y:pe.top,width:Math.max(1,ge.bandwidth),height:pe.bottom-pe.top,fill:"transparent",onMouseEnter:()=>Et(e),onPointerDown:()=>Bt.press(e),onPointerEnter:()=>Bt.over(e),onPointerUp:Bt.release,onClick:yt?()=>yt(Ht(e)):void 0,style:yt?{cursor:"pointer"}:void 0},`hit-${e}`))]}),Bt.view&&/* @__PURE__ */P(k,{from:Kt?.[0]??J[0],to:Kt?.at(-1)??J[J.length-1],count:J.length,total:Z&&"percent"!==X?At(Zt.reduce((t,e)=>t+e,0)):ae?At(be.reduce((t,e)=>t+e.data.filter(Y).reduce((t,e)=>t+e,0),0)):void 0,rows:(ae?be:Jt).filter(t=>t.data.some(Y)).map(t=>{const e=t.data.filter(Y),a=z(t.slot,t.color,t.tone);if(0===e.length)return{key:t.key,label:t.label,color:a,value:"—"};const r=e.reduce((t,e)=>t+e,0),o=Z||"column"===t.mode?At(r):$t.zoomLevel(At(r/e.length),At(Math.max(...e)));return{key:t.key,label:t.label,color:a,value:o}}),onClear:Bt.clear}),ht&&Ot.length>2&&/* @__PURE__ */P(t,{className:"mt-1",labels:Ot,width:Rt,data:K[0]?.data??[],range:Ft,onRangeChange:t=>{ft?ft(t):Ut(t)}}),null!==Wt&&
|
|
22
|
+
/* @__PURE__ */P("div",{className:"pointer-events-none absolute top-2 z-10",style:x(ge.center(Wt),ge.bandwidth,Rt),children:/* @__PURE__ */P(p,{title:Kt?.[Wt]??J[Wt],rows:Jt.map((t,e)=>({key:t.key,label:t.label,color:z(t.slot,t.color,t.tone),value:Y(t.data[Wt])?Z&&"percent"===X?`${W(100*(Xt(t.data[Wt],Wt)??0),1,Vt)} · ${At(t.data[Wt])}`:At(t.data[Wt]):void 0})),footnote:Z&&"percent"===X?$t.inBucket(At(Zt[Wt])):void 0})})]})}export{K as TimeSeriesChart};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Breadcrumbs as e}from"./chunk-
|
|
1
|
+
import{Breadcrumbs as e}from"./chunk-XYECIBVX.js";import{jsxs as t,jsx as s}from"react/jsx-runtime";function i({title:i,description:r,subtitle:c,actions:a,children:n,icon:l,breadcrumbs:m}){const d=r??c,h=a??n;/* @__PURE__ */
|
|
2
2
|
return t("div",{className:"mb-6",children:[m&&m.length>0&&/* @__PURE__ */s(e,{items:m,className:"mb-3"}),
|
|
3
3
|
/* @__PURE__ */t("div",{className:"flex items-start justify-between gap-4",children:[
|
|
4
4
|
/* @__PURE__ */t("div",{children:[
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{setPdfPreview as e}from"./chunk-ESL5TDNA.js";import{setSpreadsheetPreview as t}from"./chunk-VTVSMRFX.js";import{toast_default as n}from"./chunk-
|
|
1
|
+
import{setPdfPreview as e}from"./chunk-ESL5TDNA.js";import{setSpreadsheetPreview as t}from"./chunk-VTVSMRFX.js";import{toast_default as n}from"./chunk-7ELJQL7J.js";var i="react-os-shell:preview-opened";async function o(o){const{filePath:a,filename:r,kind:c,onStaged:s}=o;try{const o=await fetch(`${("undefined"!=typeof window&&window.__REACT_OS_SHELL_FILE_SERVER__||"http://localhost:4000").replace(/\/$/,"")}/api/file?path=${encodeURIComponent(a)}`,{credentials:"include"});if(!o.ok)return n.error(`Download failed (${o.status})`),!1;const d=await o.blob();if("csv"===c){const e=await d.text();t({csv:e,filename:r}),s?.("/spreadsheet")}else{const t=URL.createObjectURL(d);e({url:t,filename:r,kind:c}),s?.("/preview")}return"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent(i,{detail:{filePath:a,filename:r,kind:c}})),!0}catch(e){return n.error(e?.message||"Open failed"),!1}}export{i as PREVIEW_OPENED_EVENT,o as openPreviewFile};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{GROUP_COLORS as e,BADGE_PILL as o}from"./chunk-TXDA7TTP.js";import{Icon as i}from"./chunk-2UO47XB4.js";import{OneLineLabel as r}from"./chunk-MVZRZTQP.js";import{useShellStrings as s}from"./chunk-
|
|
1
|
+
import{GROUP_COLORS as e,BADGE_PILL as o}from"./chunk-TXDA7TTP.js";import{Icon as i}from"./chunk-2UO47XB4.js";import{OneLineLabel as r}from"./chunk-MVZRZTQP.js";import{useShellStrings as s}from"./chunk-GDQJBQ5B.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,7 +1,7 @@
|
|
|
1
|
-
import{MOVE_KEYS as e,MoveHint as r,moveFromKey as t}from"./chunk-
|
|
2
|
-
return d(u.Provider,{value:i,children:/* @__PURE__ */d("div",{...o,role:"list","aria-label":r?void 0:e,"aria-labelledby":r,"data-sortable-list":i,className:`flex min-w-0 flex-col ${"comfortable"===i?"gap-2":"gap-1"} ${a}`.trim(),children:t})})}function b({children:o,title:f,thumb:b,expanded:p,onToggle:h,actions:g,below:v,active:x=!1,flat:w=!1,draggable:y=!1,dragging:N=!1,drop:k,onMove:j,rowProps:
|
|
1
|
+
import{MOVE_KEYS as e,MoveHint as r,moveFromKey as t}from"./chunk-LYHJHUQH.js";import{Icon as i}from"./chunk-2UO47XB4.js";import{useBrowserLayoutEffect as a}from"./chunk-D65T4H6J.js";import{createContext as o,useContext as n,useRef as l,useId as s}from"react";import{jsx as d,jsxs as c,Fragment as m}from"react/jsx-runtime";var u=o("compact");function f({"aria-label":e,"aria-labelledby":r,children:t,spacing:i="compact",className:a="",rootProps:o}){/* @__PURE__ */
|
|
2
|
+
return d(u.Provider,{value:i,children:/* @__PURE__ */d("div",{...o,role:"list","aria-label":r?void 0:e,"aria-labelledby":r,"data-sortable-list":i,className:`flex min-w-0 flex-col ${"comfortable"===i?"gap-2":"gap-1"} ${a}`.trim(),children:t})})}function b({children:o,title:f,thumb:b,expanded:p,onToggle:h,actions:g,below:v,active:x=!1,flat:w=!1,draggable:y=!1,dragging:N=!1,drop:k,onMove:j,rowProps:B,rowRef:D,className:H=""}){const P=x||!!p,$=n(u),A=l(null),I=s(),J=[B?.["aria-describedby"],j?I:void 0].filter(Boolean).join(" ")||void 0,K=B?.tabIndex;a(()=>{const e=A.current;if(!e||void 0!==K)return;const r=[...e.querySelectorAll('a[href], button, input, select, textarea, [contenteditable]:not([contenteditable="false"]), [tabindex]')].some(r=>r!==e);j&&!r?e.tabIndex=0:e.removeAttribute("tabindex")});const T="comfortable"===$?{before:"-top-[5px]",after:"-bottom-[5px]"}:{before:"-top-0.5",after:"-bottom-0.5"},U=null!=f&&/* @__PURE__ */c(m,{children:[null!=b&&/* @__PURE__ */d("span",{"aria-hidden":"true",className:"inline-flex h-6 w-6 shrink-0 overflow-hidden rounded-sm",children:b}),
|
|
3
3
|
/* @__PURE__ */d("span",{"data-list-row-name":"",className:"min-w-0 flex-1 break-words font-semibold text-(--ink-strongest)",children:f})]});/* @__PURE__ */
|
|
4
|
-
return c("div",{role:"listitem","data-list-item":"","data-drop":k,"data-open":
|
|
5
|
-
/* @__PURE__ */c("div",{...
|
|
6
|
-
/* @__PURE__ */c("div",{"data-list-row-main":"",className:"flex min-h-8 min-w-0 flex-1 items-center gap-1",children:[
|
|
7
|
-
/* @__PURE__ */d(i,{name:"chevron-right","aria-hidden":"true",strokeWidth:"2",className:"h-4 w-4 shrink-0 transition-transform duration-(--motion-base) motion-reduce:transition-none "+(p?"rotate-90":"")})]}):/* @__PURE__ */d("span",{"data-list-row-title":"",className:"flex min-w-0 flex-1 items-center gap-2 py-2",children:
|
|
4
|
+
return c("div",{role:"listitem","data-list-item":"","data-drop":k,"data-open":P||void 0,className:["relative flex min-w-0 flex-col",w?"":"rounded-(--radius-card) border bg-surface transition-colors duration-(--motion-fast)",w?"":P?"border-blue-300":"border-line hover:border-gray-300"].filter(Boolean).join(" "),children:[k&&/* @__PURE__ */d("span",{"aria-hidden":"true","data-list-drop-line":"",className:`pointer-events-none absolute inset-x-2 z-10 h-0.5 rounded-full bg-blue-500 ${T[k]}`}),
|
|
5
|
+
/* @__PURE__ */c("div",{...B,ref:e=>{var r,t;A.current=e,t=e,"function"==typeof(r=D)?r(t):r&&(r.current=t)},"data-list-row":"","data-draggable":y||void 0,"aria-keyshortcuts":B?.["aria-keyshortcuts"]??(j?e:void 0),"aria-describedby":J,onKeyDown:e=>{if(B?.onKeyDown?.(e),e.defaultPrevented||!j)return;const r=t(e);r&&!e.target.closest?.("select")&&(e.preventDefault(),j(r))},className:["group/listrow relative flex min-h-8 min-w-0 items-center gap-1 rounded-md text-sm",w?"":"min-h-10 pl-3",y?"cursor-grab active:cursor-grabbing":"","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",null!=g&&!1!==g?"":"pr-2",N?"opacity-40":"",H].filter(Boolean).join(" "),children:[
|
|
6
|
+
/* @__PURE__ */c("div",{"data-list-row-main":"",className:"flex min-h-8 min-w-0 flex-1 items-center gap-1",children:[U&&(h?/* @__PURE__ */c("button",{type:"button","aria-expanded":!!p,onClick:h,"data-list-row-title":"",className:"flex min-w-0 flex-1 items-center gap-2 self-stretch rounded-sm py-2 text-left text-(--ink-strongest) rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:[U,
|
|
7
|
+
/* @__PURE__ */d(i,{name:"chevron-right","aria-hidden":"true",strokeWidth:"2",className:"h-4 w-4 shrink-0 transition-transform duration-(--motion-base) motion-reduce:transition-none "+(p?"rotate-90":"")})]}):/* @__PURE__ */d("span",{"data-list-row-title":"",className:"flex min-w-0 flex-1 items-center gap-2 py-2",children:U})),o]}),null!=g&&!1!==g&&/* @__PURE__ */d("div",{"data-list-actions":"",className:"flex shrink-0 items-center gap-0.5",children:g}),j&&/* @__PURE__ */d(r,{id:I})]}),null!=v&&!1!==v&&/* @__PURE__ */d("div",{"data-list-below":"",className:w?"":"px-3 pb-3",children:v})]})}export{b as ListRow,f as SortableList};
|