efficient-shell 8.21.1 → 8.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/{Browser-33BAOVZA.js → Browser-VZU2MTSA.js} +14 -14
- package/dist/Calculator-DKZHOHOD.js +29 -0
- package/dist/{CurrencyConverter-ONCRQNI4.js → CurrencyConverter-BSQCX3HS.js} +9 -9
- package/dist/{Documents-LE46Z6RO.js → Documents-NR3T434J.js} +16 -16
- package/dist/{Files-PD7KZM2Y.js → Files-QMV2E74S.js} +23 -23
- package/dist/{Notepad-NYFR5HWW.js → Notepad-M5MCY5DV.js} +10 -10
- package/dist/{PdfViewer-ZFZ4PEAV.js → PdfViewer-OODU3XIT.js} +1 -1
- package/dist/{PomodoroTimer-JVQ5K7B4.js → PomodoroTimer-I423ZZOQ.js} +58 -58
- package/dist/{Preview-CPT6HLMR.js → Preview-QTDCPMCL.js} +7 -7
- package/dist/Sidebar-UVBEI4DQ.js +43 -0
- package/dist/{Spreadsheet-BEIPEEOO.js → Spreadsheet-V2EWOJML.js} +13 -13
- package/dist/{Stock-TWJNCTNT.js → Stock-U3G45T36.js} +2 -2
- package/dist/{Weather-RM7GPLAH.js → Weather-GEC4VHLM.js} +15 -15
- package/dist/{WorldClock-ITJ2MO75.js → WorldClock-6ORV4NHF.js} +5 -5
- package/dist/ai/index.js +14 -14
- 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/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-255BENW2.js +7 -0
- package/dist/{chunk-ZBLNVAZ4.js → chunk-2IV4XF3Y.js} +2 -2
- package/dist/{chunk-MHYOQMBV.js → chunk-2JYQF3PJ.js} +1 -1
- package/dist/{chunk-3Z7LIHMB.js → chunk-2RJKMYON.js} +1 -1
- package/dist/{chunk-6V753BUI.js → chunk-2TBC254V.js} +3 -3
- package/dist/{chunk-5Z2WLSFM.js → chunk-352MVBF7.js} +20 -20
- package/dist/{chunk-CFLVEKSH.js → chunk-35VA5UFB.js} +1 -1
- package/dist/{chunk-IJA5ZAGL.js → chunk-3APQ5V6P.js} +1 -1
- package/dist/{chunk-D5HHU5AO.js → chunk-3UL7IB25.js} +7 -7
- package/dist/{chunk-N7VNKAXZ.js → chunk-46M6AYFJ.js} +1 -1
- package/dist/{chunk-AH2AUQYM.js → chunk-4ELYV3L6.js} +1 -1
- package/dist/{chunk-YGEK2Z6P.js → chunk-52L6IBTN.js} +1 -1
- package/dist/{chunk-B55IXYDR.js → chunk-53ROHXAV.js} +2 -2
- package/dist/{chunk-4VK3GJZI.js → chunk-56C5SEZ7.js} +1 -1
- package/dist/{chunk-U5I7IF72.js → chunk-5B73MLXV.js} +1 -1
- package/dist/{chunk-7M7ESM5V.js → chunk-5BBDUKQP.js} +12 -12
- package/dist/{chunk-MWAYM46R.js → chunk-5EK4DFB5.js} +11 -11
- package/dist/{chunk-JYOI66DT.js → chunk-5LNFW5E4.js} +1 -1
- package/dist/{chunk-AJ42UE53.js → chunk-5OGWWBJY.js} +1 -1
- package/dist/{chunk-4CWKK5HV.js → chunk-6AJM3QNG.js} +4 -4
- package/dist/{chunk-2BS74SYW.js → chunk-6DT7HG3F.js} +1 -1
- package/dist/{chunk-DNCII5C4.js → chunk-6JCIQ7XL.js} +6 -6
- package/dist/{chunk-7S2I6ACG.js → chunk-6PWLY2LQ.js} +1 -1
- package/dist/chunk-6UBBY54N.js +2 -0
- package/dist/{chunk-MFEJ6TYE.js → chunk-74HUZZPT.js} +1 -1
- package/dist/{chunk-NL6VHSUN.js → chunk-74QAQXSB.js} +1 -1
- package/dist/{chunk-DO6XTJ77.js → chunk-7AINUMUA.js} +1 -1
- package/dist/{chunk-UY47AKZU.js → chunk-ALYBCDHU.js} +5 -5
- package/dist/{chunk-M5BFTFBK.js → chunk-AXQBQH55.js} +15 -15
- package/dist/{chunk-ZDK2JYH5.js → chunk-B73YLHD2.js} +54 -54
- package/dist/{chunk-VY7EPQEG.js → chunk-BBYHBN3R.js} +1 -1
- package/dist/{chunk-DLCIGDKC.js → chunk-BJEBOXTR.js} +3 -3
- package/dist/{chunk-HVVPBAP5.js → chunk-BJKZYQFA.js} +3 -3
- package/dist/{chunk-HYFHCPNJ.js → chunk-BUWOFJGM.js} +8 -8
- package/dist/{chunk-AXZEINMF.js → chunk-C3ZZDCBU.js} +18 -18
- package/dist/chunk-CGUMJZUB.js +2 -0
- package/dist/{chunk-OTU633XJ.js → chunk-CJKDYVNE.js} +6 -6
- package/dist/chunk-CPM3BQGV.js +14 -0
- package/dist/{chunk-HJIBTA6V.js → chunk-CQZEO4UV.js} +9 -9
- package/dist/{chunk-EL3O7ZFQ.js → chunk-CREVU3AF.js} +1 -1
- package/dist/{chunk-P7WUDHIP.js → chunk-D3BDPSVV.js} +6 -6
- package/dist/{chunk-B4XPFCCQ.js → chunk-D7AA5WE2.js} +2 -2
- package/dist/{chunk-OCCHDMEV.js → chunk-DIW6WT5L.js} +1 -1
- package/dist/chunk-DIZW2GZP.js +3 -0
- package/dist/{chunk-L6FLPBU2.js → chunk-DQB3ORB7.js} +5 -5
- package/dist/chunk-DSYIKLOK.js +11 -0
- package/dist/chunk-EUOFKZI3.js +19 -0
- package/dist/{chunk-UBVFIIXS.js → chunk-F3AROMIU.js} +6 -6
- package/dist/{chunk-WRJDHFLD.js → chunk-F6YIUCIJ.js} +4 -4
- package/dist/{chunk-TT3S2XVQ.js → chunk-F6YMKW5G.js} +1 -1
- package/dist/{chunk-GNXTOUPJ.js → chunk-FDENTKSM.js} +5 -5
- package/dist/{chunk-KZEQJVBO.js → chunk-FLQIF7HC.js} +3 -3
- package/dist/{chunk-BIS5PHHV.js → chunk-FW2EEIDB.js} +2 -2
- package/dist/{chunk-XWH6KVVB.js → chunk-GKTCCPME.js} +1 -1
- package/dist/{chunk-Y5ZWPU4L.js → chunk-GTKNEJ3X.js} +7 -7
- package/dist/{chunk-IKNNHEVY.js → chunk-GVNDUNQL.js} +1 -1
- package/dist/{chunk-IY3CRZRH.js → chunk-HLZZ5Q5E.js} +20 -20
- package/dist/{chunk-VOHZQVFK.js → chunk-I2FHDMIN.js} +6 -6
- package/dist/{chunk-NKJDOQVW.js → chunk-IJICE6KT.js} +1 -1
- package/dist/{chunk-6GVJ6IKD.js → chunk-IMDLBXO3.js} +1 -1
- package/dist/{chunk-IMF537IJ.js → chunk-IOESXYEI.js} +9 -9
- package/dist/{chunk-55WFJELE.js → chunk-IUBWN3OA.js} +1 -1
- package/dist/{chunk-PG6AVBSR.js → chunk-JACPHDTK.js} +1 -1
- package/dist/chunk-JGZLLQAN.js +8 -0
- package/dist/{chunk-DIKOEJ2Y.js → chunk-JLPTSC66.js} +1 -1
- package/dist/{chunk-LMLM4KHQ.js → chunk-JXGYIV44.js} +8 -8
- package/dist/{chunk-ECZT7SIE.js → chunk-KBLMTCTD.js} +1 -1
- package/dist/{chunk-IPOSLLLU.js → chunk-KFSNSDTW.js} +9 -9
- package/dist/{chunk-ES3WKDZC.js → chunk-L2JOLPJR.js} +1 -1
- package/dist/{chunk-QJPLM2KQ.js → chunk-LQHWFL5Y.js} +1 -1
- package/dist/{chunk-F2Z6IXMM.js → chunk-LVAGFIWK.js} +2 -2
- package/dist/{chunk-VX4BNYH3.js → chunk-MIZO6SQ3.js} +2 -2
- package/dist/{chunk-OZF4QAJT.js → chunk-MRLQH2GZ.js} +3 -3
- package/dist/{chunk-MKITHLDU.js → chunk-MWNZY33B.js} +9 -9
- package/dist/{chunk-MOOBUMON.js → chunk-NE42BDQX.js} +5 -5
- package/dist/chunk-NHFLTKPK.js +11 -0
- package/dist/{chunk-LDFRVV5R.js → chunk-NYLXA2EG.js} +7 -7
- package/dist/{chunk-H7ZXUGXX.js → chunk-O3NLPJH2.js} +16 -16
- package/dist/chunk-O5KDTFK5.js +8 -0
- package/dist/{chunk-PJCVNFWM.js → chunk-O6JX6RDX.js} +7 -7
- package/dist/{chunk-L2YW3END.js → chunk-ONEF47LG.js} +3 -3
- package/dist/{chunk-CU2B7G5A.js → chunk-OPFCLDVM.js} +1 -1
- package/dist/chunk-PFB2NSSS.js +14 -0
- package/dist/{chunk-NDTMQRR2.js → chunk-PHYI7M45.js} +1 -1
- package/dist/chunk-PMOGQHYX.js +20 -0
- package/dist/{chunk-THDSOVEH.js → chunk-POMS7YQN.js} +2 -2
- package/dist/{chunk-MTSZ66O4.js → chunk-PZFETJAG.js} +1 -1
- package/dist/{chunk-NBVF2CXM.js → chunk-Q6A6W3DI.js} +1 -1
- package/dist/chunk-QLAQ6ASB.js +5 -0
- package/dist/{chunk-EDQBTPDF.js → chunk-QSN7X27F.js} +5 -5
- package/dist/{chunk-OSVN2UF7.js → chunk-QUS3C264.js} +1 -1
- package/dist/{chunk-IGCXJHAK.js → chunk-QZRH7L2E.js} +1 -1
- package/dist/{chunk-DMLJOBQS.js → chunk-R4JU7MU2.js} +6 -6
- package/dist/{chunk-MEOICYR5.js → chunk-R5FFVK2W.js} +1 -1
- package/dist/{chunk-YVBFFE4Z.js → chunk-RIGW3E5M.js} +4 -4
- package/dist/chunk-RPK3U2K2.js +9 -0
- package/dist/chunk-RPTQCFLR.js +29 -0
- package/dist/{chunk-K4DZWCUP.js → chunk-SDORX5C2.js} +5 -5
- package/dist/{chunk-NRDO5IHL.js → chunk-SFWIYB4T.js} +1 -1
- package/dist/{chunk-IURSUMDO.js → chunk-SH6ZLK4K.js} +3 -3
- package/dist/{chunk-ERFM5U3M.js → chunk-SLORZA7W.js} +10 -10
- package/dist/{chunk-YSHS6QIY.js → chunk-SO4WAMVA.js} +5 -5
- package/dist/{chunk-EAEUSMYL.js → chunk-SRMRRJ5K.js} +1 -1
- package/dist/{chunk-RAQESAQZ.js → chunk-SSOLRTVS.js} +1 -1
- package/dist/{chunk-A4U4BTN3.js → chunk-TCN7XUCY.js} +4 -4
- package/dist/{chunk-24L7NLA3.js → chunk-TJPPV7KZ.js} +1 -1
- package/dist/{chunk-AJD24TNB.js → chunk-TSOBVLV5.js} +1 -1
- package/dist/{chunk-AVOVYKVL.js → chunk-TYZ4IY7F.js} +2 -2
- package/dist/{chunk-QEVIQZIE.js → chunk-U4QZIU7X.js} +2 -2
- package/dist/chunk-URFWJZTV.js +7 -0
- package/dist/{chunk-PWOFYFMO.js → chunk-V23TPYHO.js} +5 -5
- package/dist/{chunk-BXM72C73.js → chunk-V4WNEJ63.js} +1 -1
- package/dist/chunk-VKMEQKYT.js +1 -0
- package/dist/{chunk-NNKMEF3D.js → chunk-VNYFGNHO.js} +1 -1
- package/dist/{chunk-36MUTG34.js → chunk-VWMTQLVS.js} +1 -1
- package/dist/{chunk-ZKOIGLRF.js → chunk-W7NZKU27.js} +6 -6
- package/dist/{chunk-EXMFUK3A.js → chunk-W7ZAFS7C.js} +8 -8
- package/dist/{chunk-YTGWIMXB.js → chunk-WBU7NZBP.js} +1 -1
- package/dist/{chunk-RZBHO74V.js → chunk-WQKGBPOQ.js} +1 -1
- package/dist/{chunk-AX7KPMDV.js → chunk-WSODT2L5.js} +2 -2
- package/dist/{chunk-LVSPLCGG.js → chunk-WXIEWJF7.js} +1 -1
- package/dist/{chunk-RCRI6QZV.js → chunk-X2U5XB7J.js} +1 -1
- package/dist/{chunk-PVSGQN5M.js → chunk-X7JK22X2.js} +6 -6
- package/dist/{chunk-LQQMELJM.js → chunk-XCHY6QVH.js} +7 -7
- package/dist/{chunk-CUT7PAXL.js → chunk-XFBXKKOB.js} +1 -1
- package/dist/{chunk-CMYLTCPA.js → chunk-XFIMTNUH.js} +1 -1
- package/dist/{chunk-N65HZ3TK.js → chunk-XUQQCKKD.js} +1 -1
- package/dist/{chunk-3HNK7IRJ.js → chunk-YF7A3BWA.js} +3 -3
- package/dist/chunk-YPXVOPL4.js +1 -0
- package/dist/{chunk-VHAM5TD2.js → chunk-Z4UKLPGE.js} +1 -1
- package/dist/{chunk-TW6WEYGO.js → chunk-Z5TCGLCM.js} +6 -6
- package/dist/{chunk-NSCLFAKK.js → chunk-ZI7P5YGF.js} +1 -1
- package/dist/{chunk-UFVQ7ZBP.js → chunk-ZLGU4VYO.js} +5 -5
- package/dist/{chunk-RAI3GTS6.js → chunk-ZMLRNHMS.js} +1 -1
- package/dist/{chunk-RDPUVCXR.js → chunk-ZVTOB4RE.js} +1 -1
- package/dist/{chunk-OZPYTSPD.js → chunk-ZY62UQI2.js} +15 -15
- package/dist/data/DataTable.js +1 -1
- package/dist/data/Kanban.js +1 -1
- package/dist/data/ListFooter.js +1 -1
- package/dist/data/ListLoadError.js +1 -1
- package/dist/data/Pagination.js +1 -1
- package/dist/file-intake/index.js +1 -1
- package/dist/format/index.js +1 -1
- package/dist/forms/BorderInput.js +1 -1
- package/dist/forms/BrandAssetEditor.js +1 -1
- package/dist/forms/Calendar.js +1 -1
- package/dist/forms/ColorPicker.js +1 -1
- package/dist/forms/ComposerAttachments.js +1 -1
- package/dist/forms/CornersInput.js +1 -1
- package/dist/forms/DatePicker.js +1 -1
- package/dist/forms/DateRangePicker.js +1 -1
- package/dist/forms/DateTimePicker.js +1 -1
- package/dist/forms/DisplayChips.js +1 -1
- package/dist/forms/FilePicker.js +1 -1
- package/dist/forms/FormErrorSummary.js +1 -1
- package/dist/forms/IconPicker.js +1 -1
- package/dist/forms/ImageFocusPoint.js +1 -1
- package/dist/forms/InputNumber.js +1 -1
- package/dist/forms/LinkPicker.js +1 -1
- package/dist/forms/MediaLibrary.d.ts +11 -0
- 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.js +1 -1
- package/dist/forms/SidesInput.js +1 -1
- package/dist/forms/Slider.js +1 -1
- package/dist/forms/Snippet.js +1 -1
- package/dist/forms/SplitButton.js +1 -1
- package/dist/forms/TagInput.js +1 -1
- package/dist/forms/TextToolbar.js +1 -1
- package/dist/forms/TimePicker.js +1 -1
- package/dist/forms/WidthsBar.js +1 -1
- package/dist/forms/mediaLibraryMenu.d.ts +5 -1
- package/dist/forms/mediaLibraryMenu.js +1 -1
- package/dist/forms/mediaMoveItems.js +1 -1
- package/dist/forms/useFileIntake.js +1 -1
- package/dist/icons/index.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +394 -394
- package/dist/locales/zh-Hans.js +1 -1
- package/dist/map/index.js +5 -5
- package/dist/page-tabs/index.js +5 -5
- package/dist/pdf/index.js +1 -1
- package/dist/shell/Accordion.js +1 -1
- package/dist/shell/AppUpdateBanner.js +1 -1
- package/dist/shell/Avatar.js +1 -1
- package/dist/shell/Banner.js +1 -1
- package/dist/shell/Breadcrumbs.js +1 -1
- package/dist/shell/BudgetBar.js +1 -1
- package/dist/shell/Card.js +1 -1
- package/dist/shell/ColoredBadge.js +1 -1
- package/dist/shell/ConfirmDialog.js +1 -1
- package/dist/shell/ContainerFillChart.js +1 -1
- package/dist/shell/ContextMenu.js +1 -1
- package/dist/shell/CountBadge.js +1 -1
- package/dist/shell/Dialog.js +1 -1
- package/dist/shell/Drawer.js +1 -1
- package/dist/shell/DropdownMenu.js +1 -1
- package/dist/shell/EditableGrid.js +1 -1
- package/dist/shell/EmptyState.js +1 -1
- package/dist/shell/GlobalSearch.js +1 -1
- package/dist/shell/HelpCenter.js +1 -1
- package/dist/shell/IconRail.js +1 -1
- package/dist/shell/ImageLightbox.js +1 -1
- package/dist/shell/LanguageSelect.js +1 -1
- package/dist/shell/Markdown.js +1 -1
- package/dist/shell/MetricBar.js +1 -1
- package/dist/shell/MetricBarLegend.js +1 -1
- package/dist/shell/MilestoneTimeline.js +1 -1
- package/dist/shell/PageHeader.js +1 -1
- package/dist/shell/PopupMenu.js +1 -1
- package/dist/shell/ProductionTimeline.js +1 -1
- package/dist/shell/ResizeHandle.js +1 -1
- package/dist/shell/Result.js +1 -1
- package/dist/shell/SearchableSelect.js +1 -1
- package/dist/shell/SettingReset.js +1 -1
- package/dist/shell/SettingRow.js +1 -1
- package/dist/shell/SidebarLayout.js +1 -1
- package/dist/shell/SidebarNav.js +1 -1
- package/dist/shell/SortableList.js +1 -1
- package/dist/shell/Statistic.js +1 -1
- package/dist/shell/TimeAgo.js +1 -1
- package/dist/shell/TimelineTrack.js +1 -1
- package/dist/shell/TopNav.js +1 -1
- package/dist/shell/TransferProgress.js +1 -1
- package/dist/shell/Tree.js +1 -1
- package/dist/shell/ZoomableImage.d.ts +9 -1
- package/dist/shell/ZoomableImage.js +1 -1
- package/dist/shell/language.js +1 -1
- package/dist/shell/strings.d.ts +4 -0
- package/dist/shell/strings.js +1 -1
- package/dist/shell/toast.js +1 -1
- package/dist/telemetry/index.js +1 -1
- package/dist/templates/AuthScreen.js +1 -1
- package/dist/templates/ChatTemplate.js +1 -1
- package/dist/templates/CheckoutTemplate.js +1 -1
- package/dist/templates/DashboardTemplate.js +1 -1
- package/dist/templates/DataTablePage.js +1 -1
- package/dist/templates/EmailTemplate.js +1 -1
- package/dist/templates/ErrorBoundary.js +1 -1
- package/dist/templates/ErrorPage.js +1 -1
- package/dist/templates/FormLayoutPage.js +1 -1
- package/dist/templates/GalleryTemplate.js +1 -1
- package/dist/ui/index.d.ts +1 -1
- package/dist/ui/index.js +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/Calculator-FHN36ZE3.js +0 -29
- package/dist/Sidebar-OFRMBB5V.js +0 -43
- package/dist/chunk-4PZN25MV.js +0 -20
- package/dist/chunk-5U3WEVZL.js +0 -19
- package/dist/chunk-6WNQ5ENK.js +0 -8
- package/dist/chunk-73DAZUJP.js +0 -14
- package/dist/chunk-DLS2VCBK.js +0 -3
- package/dist/chunk-DNKACLRF.js +0 -11
- package/dist/chunk-EKWSGPJ4.js +0 -8
- package/dist/chunk-ETSKG62F.js +0 -1
- package/dist/chunk-JGE7S7RQ.js +0 -29
- package/dist/chunk-K7Y6VDCC.js +0 -11
- package/dist/chunk-KPFOXLN4.js +0 -5
- package/dist/chunk-L2HZ7YXS.js +0 -14
- package/dist/chunk-OF6TUQAL.js +0 -7
- package/dist/chunk-U5KIRPLV.js +0 -2
- package/dist/chunk-WBEMN4JG.js +0 -9
- package/dist/chunk-WDXJWC3Y.js +0 -7
- package/dist/chunk-Y7V7CMKP.js +0 -2
- package/dist/chunk-YUIY7QOR.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{AccessibleTable as e}from"./chunk-CDRXZBVR.js";import{arcPath as t}from"./chunk-VFC6QUEN.js";import{useHighlight as r}from"./chunk-CNYAHYE6.js";import{ChartTooltip as l}from"./chunk-P5BOTIJU.js";import{CHART_INK as a,resolveSeriesColor as n}from"./chunk-TZFACUMR.js";import{useShellStrings as i,useShellLocale as o}from"./chunk-
|
|
1
|
+
import{AccessibleTable as e}from"./chunk-CDRXZBVR.js";import{arcPath as t}from"./chunk-VFC6QUEN.js";import{useHighlight as r}from"./chunk-CNYAHYE6.js";import{ChartTooltip as l}from"./chunk-P5BOTIJU.js";import{CHART_INK as a,resolveSeriesColor as n}from"./chunk-TZFACUMR.js";import{useShellStrings as i,useShellLocale as o}from"./chunk-VKMEQKYT.js";import{formatPlain as h,formatPercent as c}from"./chunk-C3QOHMR6.js";import{useState as u}from"react";import{jsx as s,jsxs as d}from"react/jsx-runtime";function m(e,t,r,l,a,n,i,o){if(l>=8)return;const h=e.reduce((e,t)=>e+p(t,8-l),0);if(h<=0)return;let c=t;e.forEach((e,t)=>{const u=p(e,8-l),s=u/h*r,d=`${i}/${e.key}`,f=0===l?t:a,b=0===l?e.key:n;o.push({id:d,label:e.label,value:u,depth:l,start:c,end:c+s,branch:f,branchKey:b}),e.children?.length&&m(e.children,c,s,l+1,f,b,d,o),c+=s})}function p(e,t){return t>0&&e.children?.length?e.children.reduce((e,r)=>e+p(r,t-1),0):Math.max(0,e.value??0)}function f({nodes:p,size:f=320,innerRadius:b=44,ringGap:v=2,formatValue:k,centerLabel:x,className:g,emptyLabel:y}){const M=i().charts,$=o(),j=k??(e=>h(e,$)),N=y??M.nothingToBreakDown,[w,C]=u(null),{highlighted:E}=r(),R=[];if(m(p,-Math.PI/2,2*Math.PI,0,0,"","",R),0===R.length)/* @__PURE__ */return s("p",{className:`text-sm text-gray-500 ${g??""}`,children:N});const B=Math.max(...R.map(e=>e.depth))+1,I=f/2,K=f/2,L=(f/2-8-b)/B,T=R.filter(e=>0===e.depth).reduce((e,t)=>e+t.value,0),V=e=>`color-mix(in oklab, ${n(e.branch)} ${Math.max(16,100-24*e.depth).toFixed(0)}%, ${a.surface})`,z=e=>null!==w?e.id===w:null===E||e.branchKey===E,A=w?R.find(e=>e.id===w):void 0,F=e=>c(e.value/T*100,1,$);/* @__PURE__ */
|
|
2
2
|
return d("div",{className:`relative ${g??""}`,children:[
|
|
3
|
-
/* @__PURE__ */d("svg",{width:"100%",height:f,viewBox:`0 0 ${f} ${f}`,role:"img","aria-label":M.sunburst(j(T),B),onMouseLeave:()=>C(null),children:[R.map(e=>/* @__PURE__ */s("path",{d:t(
|
|
4
|
-
/* @__PURE__ */s(e,{caption:M.sunburst(j(T),B),head:[M.tableLevel,M.tableItem,M.value,M.share],rows:R.map(e=>[e.depth+1,e.label,j(e.value),
|
|
3
|
+
/* @__PURE__ */d("svg",{width:"100%",height:f,viewBox:`0 0 ${f} ${f}`,role:"img","aria-label":M.sunburst(j(T),B),onMouseLeave:()=>C(null),children:[R.map(e=>/* @__PURE__ */s("path",{d:t(I,K,b+e.depth*L+v/2,b+(e.depth+1)*L-v/2,e.start,e.end),fill:V(e),fillOpacity:z(e)?1:.45,stroke:a.surface,strokeWidth:1,onMouseEnter:()=>C(e.id)},e.id)),x&&/* @__PURE__ */s("text",{x:I,y:K+5,textAnchor:"middle",fontSize:16,fontWeight:600,fill:a.label,children:x})]}),A&&/* @__PURE__ */s("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */s(l,{title:A.label,rows:[{key:"value",label:M.value,color:V(A),value:j(A.value)},{key:"share",label:M.share,color:a.muted,value:F(A)}]})}),
|
|
4
|
+
/* @__PURE__ */s(e,{caption:M.sunburst(j(T),B),head:[M.tableLevel,M.tableItem,M.value,M.share],rows:R.map(e=>[e.depth+1,e.label,j(e.value),F(e)])})]})}export{f as SunburstChart};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{useShellStrings as t}from"./chunk-
|
|
1
|
+
import{useShellStrings as t}from"./chunk-VKMEQKYT.js";import{jsxs as e,jsx as r}from"react/jsx-runtime";var o={403:t=>({title:t.forbidden,body:t.forbiddenBody}),404:t=>({title:t.notFound,body:t.notFoundBody}),500:t=>({title:t.serverError,body:t.serverErrorBody})};function i({code:i=404,actions:n}){const d=o[i](t().errors);/* @__PURE__ */
|
|
2
2
|
return e("div",{className:"flex h-full flex-col items-center justify-center bg-gray-50 p-6 text-center",children:[
|
|
3
3
|
/* @__PURE__ */r("div",{className:"text-7xl font-bold tracking-tight text-gray-400",children:i}),
|
|
4
4
|
/* @__PURE__ */r("h1",{className:"mt-2 text-xl font-semibold text-gray-900",children:d.title}),
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import{SearchableSelect as e}from"./chunk-SLORZA7W.js";import{Select_default as a}from"./chunk-PMOGQHYX.js";import{Input_default as l}from"./chunk-UNEJ2ABD.js";import{labelClasses as t}from"./chunk-EQKUFYX6.js";import{isSafeLinkHref as r}from"./chunk-PJPK2ADX.js";import{INPUT_SIZES as n}from"./chunk-JFSYWEHD.js";import{Button_default as i}from"./chunk-4IU5BSVE.js";import{Icon as o}from"./chunk-KIBL6M3T.js";import{registerModalEscapeInterceptor as s}from"./chunk-TWVUQUUD.js";import{useShellStrings as u}from"./chunk-VKMEQKYT.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},y=e=>r(e.trim());function k(r){const{value:n,kinds:o,rules:k=x,filtersFor:w,label:N,readOnly:C,placeholder:O,className:j=""}=r,F=void 0!==r.onApply,E=u().link,$=k.isSafe??y,z=d(),A=c(null),D=c(null),[K,P]=p({url:n}),U=F?K.url:n,[M,S]=p(!1),[T,W]=p(null),[L,Q]=p(null),Y=c(()=>{});Y.current=F?r.onCancel:()=>{},m(()=>{if(F)return s(e=>{const a=A.current;return!!("Escape"===e.key&&a&&e.target instanceof Node&&a.contains(e.target))&&(Y.current(),!0)},()=>A.current)},[F]),m(()=>{if(!F)return;const e=D.current;e?(e.focus(),e.select()):A.current?.querySelector("button, input")?.focus()},[]);const B=o??[{value:b,label:E.address,target:{type:"text"}}],H=T&&T.against===U?T.kind:k.kindOf(U),J=B.filter(e=>!e.hideWhenEmpty||h(e.target).length>0||e.value===H),R=J.find(e=>"text"===e.target.type),V=J.find(e=>e.value===H)??R??J[0];if(!V)return null;const X="text"!==V.target.type,I=X?k.targetOf(U):U,q=h(V.target),G=q.find(e=>e.value===I),Z=e=>({value:e,label:E.unavailable(e)}),_="select"===V.target.type&&I&&w?w(I):null,ee=_?k.readFilter(U):null,ae=ee?_?.find(e=>e.param===ee.param):void 0,le=L&&L.against===U?L.text:U,te=!X&&""!==le.trim()&&!$(le),re=te&&(!F||M),ne=(e,a)=>{F?P({url:e,name:a}):void 0===a?r.onChange(e):r.onChange(e,a)},ie=(e,a)=>{W(a=>a?{...a,against:e}:a),ne(e,a)},oe=e=>{if(!e)return ie("");const a=q.find(a=>a.value===e);ie(e,a?.label)},se=X?U:le.trim(),ue=()=>{if(!F||!se)return;if(!X&&te)return void S(!0);const e=X&&K.url===se?K.name:void 0,a=r.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,r,n,i)=>{const o=[];for(const e of r){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=r.some(e=>""===e.value);/* @__PURE__ */
|
|
2
|
+
return f(e,{"aria-label":l,value:t,options:o,disabled:C,clearable:a,placeholder:r.find(e=>""===e.value)?.label,onChange:n})}/* @__PURE__ */
|
|
3
|
+
return f(a,{size:"sm","aria-label":l,value:t,options:o,readOnly:C,onChange:n})};let pe;if("text"===V.target.type)pe=/* @__PURE__ */f(l,{ref:D,id:`${z}-address`,size:"sm",type:"text",invalid:re,"aria-label":E.address,"aria-describedby":re?`${z}-why`:void 0,placeholder:O??E.addressPlaceholder,spellCheck:!1,autoComplete:"off",value:le,readOnly:C,onChange:e=>(e=>{S(!1);const a=e.trim();a?$(e)?(Q({text:e,against:a}),ie(a)):Q({text:e,against:U}):(Q({text:e,against:""}),ie(""))})(e.target.value)});else{const e="groups"===V.target.type?V.target.groups.flatMap(e=>e.options.map(a=>({value:a.value,label:a.label,group:e.label}))):V.target.options.map(e=>({value:e.value,label:e.label})),a=[{value:"",label:V.target.placeholder},...de(e,I)];pe=ce(V.label,I,a,oe,e.length>10)}const me=/* @__PURE__ */v(g,{children:[o&&ce(E.linkType,V.value,J.map(e=>({value:e.value,label:e.label})),e=>{Q(null),S(!1);const a=J.find(a=>a.value===e);if(!a||"text"===a.target.type)return void W({kind:e,against:U});const l=h(a.target)[0];W({kind:e,against:l?l.value:""}),l?ne(l.value,l.label):ne("")},!1),pe,_&&ce(E.filter,ee?.param??"",[{value:"",label:E.noFilter},...ee&&!ae?[Z(ee.param)]:[],..._.map(e=>({value:e.param,label:e.label}))],e=>{if(!e)return ie(I,G?.label);const a=_?.find(a=>a.param===e),l=a?.values[0];l&&ie(k.withFilter(I,{param:e,value:l.value}),l.label)},!1),_&&ee&&ce(E.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(k.withFilter(I,{param:ee.param,value:e}),a?.label)},(ae?.values.length??0)>10),re&&/* @__PURE__ */f("p",{id:`${z}-why`,role:"alert",className:"text-2xs leading-4 text-red-600",children:E.unsafe}),V.hint&&/* @__PURE__ */f("p",{className:"text-2xs leading-4 text-gray-400",children:V.hint}),_&&/* @__PURE__ */f("p",{className:"text-2xs leading-4 text-gray-400",children:E.filterHint})]});if(!F)/* @__PURE__ */
|
|
4
|
+
return f("div",{ref:A,className:`flex min-w-0 flex-auto flex-col gap-2 ${j}`.trim(),role:N?"group":void 0,"aria-label":N,children:me});const fe=r.onRemove;/* @__PURE__ */
|
|
5
|
+
return v("div",{ref:A,role:"dialog","aria-label":N??E.title,className:`flex min-w-0 flex-col gap-2 rounded-xl border border-gray-200 bg-white 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:[X?/* @__PURE__ */f("span",{className:t({inline:!0}),children:E.title}):/* @__PURE__ */f("label",{htmlFor:`${z}-address`,className:t({inline:!0}),children:E.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:E.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:()=>Y.current(),children:E.cancel}),
|
|
9
|
+
/* @__PURE__ */f(i,{variant:"primary",size:"sm","data-window-action":"apply",onClick:ue,disabled:C||""===se,children:E.apply})]})]})]})}function w({label:e,text:a,onTextChange:t,link:r,onLinkChange:i,kinds:s,rules:m,filtersFor:g,textPlaceholder:h,readOnly:b,className:x=""}){const y=u().link,[w,N]=p(!1),C=c(null),O=d(),j=()=>{N(!1),C.current?.focus()};/* @__PURE__ */
|
|
10
|
+
return v("div",{className:`flex min-w-0 flex-auto flex-col ${x}`.trim(),children:[
|
|
11
|
+
/* @__PURE__ */f(l,{size:"sm",type:"text",className:"rounded-b-none","aria-label":y.text(e),placeholder:h,value:a,readOnly:b,onChange:e=>t(e.target.value)}),
|
|
12
|
+
/* @__PURE__ */v("button",{ref:C,type:"button","aria-label":y.linkOf(e,r),"aria-expanded":w,"aria-controls":w?O:void 0,disabled:b,onClick:()=>N(e=>!e),className:`flex w-full min-w-0 items-center gap-2 rounded-b-(--radius-control) border border-t-0 border-gray-300 bg-gray-50 ${n.sm} 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 "+(r?"text-blue-600":"text-gray-400")}),
|
|
14
|
+
/* @__PURE__ */f("span",{className:"min-w-0 truncate "+(r?"text-blue-600":"text-gray-400"),children:r||y.addLink})]}),w&&/* @__PURE__ */f("div",{id:O,className:"mt-2",children:/* @__PURE__ */f(k,{value:r,label:y.linkOf(e,r),kinds:s,rules:m,filtersFor:g,onApply:(e,a)=>{void 0===a?i(e):i(e,a),j()},onRemove:r?()=>{i(""),j()}:void 0,onCancel:j})})]})}export{k as LinkPicker,w as TextLinkField};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{useShellStrings as e}from"./chunk-
|
|
1
|
+
import{useShellStrings as e}from"./chunk-VKMEQKYT.js";import{useRef as r,useEffect as t}from"react";import{jsxs as n,jsx as l}from"react/jsx-runtime";function o({errors:o,title:s,autoFocus:c=!0,className:i=""}){const d=e(),m=r(null),a=r(!1);if(t(()=>{const e=o.length>0;e&&!a.current&&c&&m.current?.focus(),a.current=e},[o.length>0,c]),0===o.length)return null;/* @__PURE__ */
|
|
2
2
|
return n("div",{ref:m,role:"alert",tabIndex:-1,className:`rounded-md border border-red-300 bg-red-50 px-4 py-3 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-invalid-solid)] ${i}`.trim(),children:[
|
|
3
3
|
/* @__PURE__ */l("h2",{className:"text-sm font-semibold text-red-800",children:s??d.form.errorSummaryTitle}),
|
|
4
4
|
/* @__PURE__ */l("ul",{className:"mt-2 space-y-1",children:o.map(({fieldId:e,message:r},t)=>/* @__PURE__ */l("li",{children:e?/* @__PURE__ */l("a",{href:`#${e}`,onClick:r=>{r.preventDefault(),(e=>{const r=document.getElementById(e);r&&(r.scrollIntoView({block:"center"}),r.focus())})(e)},className:"text-sm text-red-700 underline hover:text-red-900",children:r}):
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import{firstEnabledIndex as e,matchTypeahead as t,lastEnabledIndex as r,nextEnabledIndex as n}from"./chunk-EO5RLFRX.js";import{flattenOptionItems as i,groupedRows as a,isOptionGroup as l,OptionCheck as o}from"./chunk-UQBPKZUR.js";import{useSettingAuto as d}from"./chunk-E4Z5OXBI.js";import{inputClasses as s,PLACEHOLDER_INK as c}from"./chunk-JFSYWEHD.js";import{useIsMobile as u}from"./chunk-UGTRSRIW.js";import{optionNoteClass as p}from"./chunk-QR4RM7PO.js";import{Icon as m}from"./chunk-KIBL6M3T.js";import{onOverlayOpen as v}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as h}from"./chunk-62LW225J.js";import{useDropdownPosition as f,MENU_MAX_HEIGHT as b}from"./chunk-GLUJS42B.js";import{solidSurfaceStyle as g}from"./chunk-DTJRIWFR.js";import{registerModalEscapeInterceptor as y}from"./chunk-TWVUQUUD.js";import{useShellStrings as x}from"./chunk-VKMEQKYT.js";import{forwardRef as w,useId as k,useState as N,useRef as $,useMemo as D,useCallback as j,useEffect as T,useLayoutEffect as E}from"react";import{createPortal as I}from"react-dom";import{jsxs as O,jsx as S,Fragment as H}from"react/jsx-runtime";var C=w(function({value:e,onChange:t,options:r,placeholder:n,invalid:i,className:a="",size:l,touchSize:o,renderOption:c,renderValue:u,valueText:p,readOnly:m,footer:v,changed:h,auto:f,multiple:b,"aria-describedby":g,...y},w){const N=t,$=x(),D=d(),j=f??D,T=k(),E=/* @__PURE__ */O("select",{ref:w,value:e,multiple:b||void 0,onChange:e=>N(b?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),"aria-invalid":i||void 0,"aria-describedby":[g,j?T:void 0].filter(Boolean).join(" ")||void 0,className:s({invalid:i,size:l,auto:j,className:`pr-8 ${a}`.trim()}),...y,children:[void 0!==n&&!b&&/* @__PURE__ */S("option",{value:"",disabled:!0,children:n}),
|
|
2
|
+
/* @__PURE__ */S(K,{items:r})]});return j?/* @__PURE__ */O(H,{children:[E,
|
|
3
|
+
/* @__PURE__ */S("span",{id:T,hidden:!0,children:$.settingView.auto})]}):E});function K({items:e}){const t=e=>/* @__PURE__ */S("option",{value:e.value,disabled:e.disabled,lang:e.lang,children:e.label},e.value);/* @__PURE__ */
|
|
4
|
+
return S(H,{children:e.map((e,r)=>(e=>l(e))(e)?/* @__PURE__ */S("optgroup",{label:e.label,children:e.options.map(t)},`group-${r}`):t(e))})}var R=w(function({value:l,onChange:u,options:w,placeholder:C,invalid:R,className:z="",id:B,disabled:U,size:V,touchSize:A,title:M,multiple:P,renderOption:W,renderValue:F,valueText:L,readOnly:J=!1,footer:Q,changed:G=!1,auto:Y,"aria-describedby":q,"aria-label":X,"aria-labelledby":Z,..._},ee){const[te,re]=N(!1),[ne,ie]=N(-1),ae=$(null),le=$(null),oe=$(null),de=$(null),se=$([]),ce=()=>de.current??oe.current,ue=!!Q?.length,pe="sm"===V,me=pe?"min-h-7 px-3 py-1 text-xs leading-4":"min-h-(--row-height-menu) px-3 py-2 text-sm leading-5",ve=p(pe),[he,fe]=N(null),be=x(),ge=$(te);ge.current=te;const ye=$({buffer:"",timer:null}),xe=k(),we=`${xe}-listbox`,ke=B??`${xe}-trigger`,Ne=e=>`${xe}-opt-${e}`,$e=`${xe}-changed`,De=d(),je=Y??De,Te=`${xe}-auto`,Ee=[q,G?$e:void 0,je?Te:void 0].filter(Boolean).join(" ")||void 0,Ie=D(()=>i(w),[w]),Oe=P?l:[],Se=u,He=f(le,te,{matchTriggerWidth:!0,...Q?.length?{preferredMaxHeight:Number.POSITIVE_INFINITY}:{}}),Ce="undefined"==typeof window?T:E,Ke=`${te}|${He?.top}|${He?.bottom}|${He?.maxHeight}|${w.length}`;Ce(()=>{fe(null)},[Ke]),Ce(()=>{const e=oe.current;if(!te||!e||null!==he)return;if(e.scrollHeight<=e.clientHeight+1)return;const t=getComputedStyle(e),r=parseFloat(t.paddingTop)||0;parseFloat(t.paddingBottom);const n=e.getBoundingClientRect().top;let i=0;for(const t of e.querySelectorAll('[role="option"]')){const r=t.getBoundingClientRect().bottom-n+e.scrollTop;if(!(r<=e.clientHeight+.5))break;i=r}i>r&&fe(Math.floor(i))},[te,he,Ke]);const Re=P?Ie.findIndex(e=>Oe.includes(e.value)):Ie.findIndex(e=>e.value===l),ze=P?Ie.filter(e=>Oe.includes(e.value)).map(e=>e.label).join(", ")||void 0:Re>=0?Ie[Re].label:void 0,Be=!P&&Re>=0?Ie[Re].lang:void 0,Ue=P?Ie.filter(e=>Oe.includes(e.value)):Re>=0?[Ie[Re]]:[],Ve=F&&Ue.length?F(Ue):void 0,Ae=void 0!==Ve&&L?L(Ue):void 0,Me=j((e=!0)=>{re(!1),ie(-1),e&&le.current?.focus()},[]),Pe=j(()=>{U||J||(ie(Re>=0?Re:e(Ie)),re(!0))},[U,J,Ie,Re]),We=j(e=>{const t=Ie[e];if(t&&!t.disabled){if(P){const r=l;return Se(r.includes(t.value)?r.filter(e=>e!==t.value):[...r,t.value]),void ie(e)}Se(t.value),Me()}},[Ie,P,l,Se,Me]);T(()=>{if(!te)return;return y(e=>!("Escape"!==e.key||!ge.current)&&(Me(),!0),ce)},[te,Me]),T(()=>{if(!te)return;const e=e=>{const t=e.target;ae.current?.contains(t)||ce()?.contains(t)||Me(!1)};document.addEventListener("pointerdown",e);const t=v(()=>Me(!1));return()=>{document.removeEventListener("pointerdown",e),t()}},[te,Me]),T(()=>{!te||ne<0||oe.current?.querySelector(`#${CSS.escape(Ne(ne))}`)?.scrollIntoView({block:"nearest"})},[te,ne]);const Fe=j(e=>{const r=ye.current;r.timer&&clearTimeout(r.timer),r.buffer+=e,r.timer=setTimeout(()=>{r.buffer="",r.timer=null},500);const n=te?ne:Re,i=t(Ie,r.buffer,n);i<0||(te?ie(i):P?(ie(i),re(!0)):We(i))},[te,ne,Re,Ie,We,P]),Le=te?a(w,(e,t)=>{const r=(n=e.value,P?Oe.includes(n):l===n);var n;const i=t===ne;/* @__PURE__ */
|
|
5
|
+
return O("div",{id:Ne(t),role:"option",lang:e.description||W?void 0:e.lang,"aria-selected":r,"aria-disabled":e.disabled||void 0,onPointerEnter:()=>{e.disabled||ie(t)},onClick:()=>We(t),className:`mx-1 cursor-pointer truncate rounded-lg ${me}${P?" flex items-center gap-2":""}\n ${e.disabled?"cursor-not-allowed text-gray-400":i?"bg-blue-50 text-blue-700":r?"font-medium text-blue-600":"text-gray-700"}`,children:[P&&/* @__PURE__ */S(o,{selected:r}),W?/* @__PURE__ */S("span",{className:"block min-w-0 flex-1 truncate",children:W(e,{selected:r,active:i})}):P?/* @__PURE__ */O("span",{className:"block min-w-0 flex-1",children:[
|
|
6
|
+
/* @__PURE__ */S("span",{lang:e.lang,className:"block truncate",children:e.label}),e.description&&/* @__PURE__ */S("span",{className:ve,children:e.description})]}):e.description?
|
|
7
|
+
/* @__PURE__ */O(H,{children:[
|
|
8
|
+
/* @__PURE__ */S("span",{lang:e.lang,className:"block truncate",children:e.label}),
|
|
9
|
+
/* @__PURE__ */S("span",{className:ve,children:e.description})]}):e.label]},e.value)},xe,"mx-1"):null,Je=void 0!==Ve?
|
|
10
|
+
/* @__PURE__ */O("span",{className:"relative block min-w-0 truncate",children:[
|
|
11
|
+
/* @__PURE__ */S("span",{"aria-hidden":"true","data-select-value":"",className:"flex min-w-0 items-center gap-2 truncate",children:Ve}),
|
|
12
|
+
/* @__PURE__ */S("span",{lang:void 0===Ae?Be:void 0,className:"sr-only",children:Ae??ze})]}):/* @__PURE__ */S("span",{lang:Be,className:"block truncate "+(void 0===ze?"text-gray-400":""),children:ze??C??" "}),Qe={zIndex:h.popup,left:He?.left,top:He?.top,bottom:He?.bottom,width:He?.width,maxHeight:He?.maxHeight??b,visibility:He?void 0:"hidden",...g()},Ge=/* @__PURE__ */S("div",{ref:oe,id:we,role:"listbox","aria-labelledby":Z??(X?void 0:ke),"aria-label":Z?void 0:X,"aria-multiselectable":P||void 0,className:ue?"min-h-0 shrink overflow-y-auto py-1":"fixed overflow-y-auto rounded-(--radius-popup) py-1",style:ue?null!==he?{maxHeight:he}:void 0:null!==he?{...Qe,maxHeight:he}:Qe,children:Le}),Ye=ue?/* @__PURE__ */O("div",{ref:de,className:"fixed flex flex-col overflow-hidden rounded-(--radius-popup)",style:Qe,children:[Ge,
|
|
13
|
+
/* @__PURE__ */S("div",{className:"shrink-0 border-t border-(--rosh-glass-solid-border) px-1 py-1",children:Q.map((e,t)=>/* @__PURE__ */O("button",{ref:e=>{se.current[t]=e},type:"button","data-select-action":"","aria-disabled":e.disabled||void 0,onClick:()=>(e=>{e.disabled||(Me(),e.onSelect())})(e),onKeyDown:e=>((e,t)=>{const r=(Q?.length??0)-1,n=t=>{e.preventDefault(),se.current[t]?.focus()},i=()=>{e.preventDefault(),le.current?.focus()};switch(e.key){case"ArrowDown":return void n(Math.min(t+1,r));case"ArrowUp":return void(0===t?i():n(t-1));case"Home":return void n(0);case"End":return void n(r);case"Tab":return e.shiftKey?void(0===t?i():n(t-1)):t<r?void n(t+1):(e.preventDefault(),void Me());case"Escape":return e.preventDefault(),e.stopPropagation(),void Me()}})(e,t),className:`flex w-full items-center gap-2 rounded-lg ${me} text-left rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] ${e.disabled?"cursor-not-allowed text-gray-400":"cursor-pointer text-gray-700 hover:bg-blue-50 hover:text-blue-700"}`,children:[e.icon&&/* @__PURE__ */S(m,{name:e.icon,"aria-hidden":"true",className:"h-4 w-4 shrink-0"}),
|
|
14
|
+
/* @__PURE__ */S("span",{className:"min-w-0 flex-1 truncate",children:e.label})]},e.label))})]}):Ge;/* @__PURE__ */
|
|
15
|
+
return O("div",{ref:ae,className:"relative",children:[
|
|
16
|
+
/* @__PURE__ */S("button",{ref:le,id:ke,type:"button",role:"combobox","aria-haspopup":"listbox","aria-expanded":te,"aria-controls":te?we:void 0,"aria-activedescendant":te&&ne>=0?Ne(ne):void 0,"aria-invalid":R||void 0,"aria-describedby":Ee,"aria-label":X,"aria-labelledby":Z,title:M,disabled:U,"aria-readonly":J||void 0,onClick:()=>te?Me():Pe(),onKeyDown:t=>{if(!U&&!J)switch(t.key){case"ArrowDown":return t.preventDefault(),void(te?ie(e=>n(Ie,e,1)):Pe());case"ArrowUp":return t.preventDefault(),void(te?ie(e=>n(Ie,e,-1)):Pe());case"Home":return void(te&&(t.preventDefault(),ie(e(Ie))));case"End":return void(te&&(t.preventDefault(),ie(r(Ie))));case"Enter":return void(te&&(t.preventDefault(),We(ne)));case" ":return t.preventDefault(),void(te?We(ne):Pe());case"Escape":return void(te&&(t.preventDefault(),t.stopPropagation(),Me()));case"Tab":return te&&ue&&!t.shiftKey?(t.preventDefault(),void se.current[0]?.focus()):void(te&&Me(!1));default:1!==t.key.length||t.metaKey||t.ctrlKey||t.altKey||(t.preventDefault(),Fe(t.key))}},className:s({invalid:R,size:V,readOnly:J,auto:je,className:`${J?"":"pr-8 "}text-left ${z}`.trim()}),children:G?
|
|
17
|
+
/* @__PURE__ */O("span",{className:"flex min-w-0 items-center gap-1",children:[Je,
|
|
18
|
+
/* @__PURE__ */S("span",{"aria-hidden":"true","data-select-changed":"",className:"shrink-0",children:"*"})]}):Je}),G&&/* @__PURE__ */S("span",{id:$e,hidden:!0,children:be.select.changed}),je&&/* @__PURE__ */S("span",{id:Te,hidden:!0,children:be.settingView.auto}),!J&&/* @__PURE__ */S(m,{name:"chevron-up-down","aria-hidden":"true",className:`pointer-events-none absolute right-2.5 top-1/2 h-4 w-4 -translate-y-1/2 ${c}`,strokeWidth:2}),
|
|
19
|
+
/* @__PURE__ */O("select",{ref:ee,value:l,multiple:P||void 0,onChange:e=>Se(P?Array.from(e.target.selectedOptions,e=>e.value):e.target.value),disabled:U,"aria-hidden":"true",tabIndex:-1,className:"sr-only",..._,children:[void 0!==C&&!P&&/* @__PURE__ */S("option",{value:"",disabled:!0,children:C}),
|
|
20
|
+
/* @__PURE__ */S(K,{items:w})]}),te&&I(Ye,document.body)]})}),z=w(function({touchSize:e="touch",...t},r){const n=u();return!n||void 0===t.footer&&void 0===t.changed||t.readOnly?n&&!t.readOnly?/* @__PURE__ */S(C,{ref:r,...t,size:e}):/* @__PURE__ */S(R,{ref:r,...t}):/* @__PURE__ */S(R,{ref:r,...t,size:e})});export{C as NativeSelect,z as Select_default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Tooltip as e}from"./chunk-22S6LG6D.js";import{useBrowserLayoutEffect as r}from"./chunk-D65T4H6J.js";import{useShellStrings as t}from"./chunk-
|
|
2
|
-
return s(e,{content:z??k.hint,side:I,delay:600,className:`${
|
|
1
|
+
import{Tooltip as e}from"./chunk-22S6LG6D.js";import{useBrowserLayoutEffect as r}from"./chunk-D65T4H6J.js";import{useShellStrings as t}from"./chunk-VKMEQKYT.js";import{useRef as o,useEffect as n,useCallback as i}from"react";import{jsx as s}from"react/jsx-runtime";var a=(e,r,t)=>Math.min(t,Math.max(r,e));function l(e,r,t,o,n){return Math.round(a("left"===t||"top"===t?e+r:e-r,o,n))}function u(e,r,t){let o=null;try{o=window.localStorage.getItem(e)}catch{return null}const n=o?parseInt(o,10):NaN;return Number.isNaN(n)?null:a(n,r,t)}function c({width:c,onResize:d,orientation:h="vertical",side:m,min:f,max:p,defaultWidth:v=f,step:g=16,storageKey:b,label:w,hint:z,controls:y,className:x=""}){const P="horizontal"===h,k=t().resizeHandle,N=o(null),D=o({onResize:d,min:f,max:p,side:m});D.current={onResize:d,min:f,max:p,side:m},r(()=>{if(!b)return;const e=u(b,f,p);null!==e&&e!==c&&d(e)},[b]),n(()=>{if(!b)return;const e=window.setTimeout(()=>{try{window.localStorage.setItem(b,String(Math.round(c)))}catch{}},200);return()=>window.clearTimeout(e)},[c,b]);const M=i(()=>{N.current=null,document.body.style.removeProperty("cursor"),document.body.style.removeProperty("user-select")},[]);n(()=>M,[M]);const T=e=>{N.current&&(e.currentTarget.hasPointerCapture?.(N.current.pointer)&&e.currentTarget.releasePointerCapture(N.current.pointer),M())},C="left"===m?"right-0":"right"===m?"left-0":"top"===m?"bottom-0":"top-0",I="left"===m?"right":"right"===m?"left":"top"===m?"bottom":"top",$=P?`absolute inset-x-0 ${C} z-10 flex h-2`:`absolute inset-y-0 ${C} z-10 flex w-2`;/* @__PURE__ */
|
|
2
|
+
return s(e,{content:z??k.hint,side:I,delay:600,className:`${$} ${x}`.trim(),children:/* @__PURE__ */s("div",{role:"separator",tabIndex:0,"aria-orientation":h,"aria-label":w??k.label,"aria-valuenow":Math.round(c),"aria-valuemin":f,"aria-valuemax":p,"aria-controls":y,"data-resize-handle":m,onPointerDown:e=>{0===e.button&&(e.preventDefault(),N.current={x:P?e.clientY:e.clientX,width:c,moved:!1,pointer:e.pointerId},e.currentTarget.setPointerCapture?.(e.pointerId),document.body.style.cursor=P?"row-resize":"col-resize",document.body.style.userSelect="none")},onPointerMove:e=>{const r=N.current;if(!r)return;if(0===e.buttons)return void M();const t=(P?e.clientY:e.clientX)-r.x;if(!r.moved){if(Math.abs(t)<3)return;r.moved=!0}const{onResize:o,min:n,max:i,side:s}=D.current;o(l(r.width,t,s,n,i))},onPointerUp:T,onPointerCancel:T,onLostPointerCapture:()=>{N.current&&M()},onDoubleClick:()=>d(a(v,f,p)),onKeyDown:e=>{const r=P?"ArrowDown":"ArrowRight",t=P?"ArrowUp":"ArrowLeft",o=e.key===r?g:e.key===t?-g:null,n=null!==o?l(c,o,m,f,p):"Home"===e.key?f:"End"===e.key?p:"Enter"===e.key?a(v,f,p):null;null!==n&&(e.preventDefault(),n!==c&&d(n))},className:P?"group/resize relative h-full w-full cursor-row-resize touch-none rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring-solid)]":"group/resize relative h-full w-full cursor-col-resize touch-none rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */s("div",{"aria-hidden":"true",className:P?`absolute inset-x-0 ${C} h-px bg-transparent transition-colors group-hover/resize:bg-[var(--accent-500,var(--rosh-resize-handle))] group-focus-visible/resize:h-0.5 group-focus-visible/resize:bg-[var(--accent-500,var(--rosh-resize-handle))]`:`absolute inset-y-0 ${C} w-px bg-transparent transition-colors group-hover/resize:bg-[var(--accent-500,var(--rosh-resize-handle))] group-focus-visible/resize:w-0.5 group-focus-visible/resize:bg-[var(--accent-500,var(--rosh-resize-handle))]`})})})}export{c as ResizeHandle,u as readStoredWidth,l as resizedWidth};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Modal as e}from"./chunk-
|
|
1
|
+
import{Modal as e}from"./chunk-B73YLHD2.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 +1 @@
|
|
|
1
|
-
import{client_default as a}from"./chunk-
|
|
1
|
+
import{client_default as a}from"./chunk-B73YLHD2.js";var t=()=>a.get("/auth/numbering-configs/").then(a=>a.data?.results??a.data??[]),e="uploaded:wallpaper";function r(a,t){return"string"!=typeof a||!a||"none"===a||a.startsWith("#")?"":a===e?t||"":a}var l=()=>a.get("/auth/me/wallpaper/").then(a=>a.data),n=(t,e)=>{const r=new FormData;r.append("wallpaper",t);const l=e?{onUploadProgress:a=>e(a.total?Math.round(a.loaded/a.total*100):null)}:void 0;return a.post("/auth/me/wallpaper/",r,l).then(a=>a.data)},p=()=>a.delete("/auth/me/wallpaper/").then(a=>a.data);function o(a){const t=a?.response?.status,e=a?.response?.data,r=Array.isArray(e?.wallpaper)?e.wallpaper[0]:void 0;return r||(413===t?"That picture is too large to use as a wallpaper.":415===t?"That file is not a picture this can use as a wallpaper.":"The wallpaper could not be saved. Please try again.")}export{e as WALLPAPER_PREF_TOKEN,p as deleteWallpaper,t as getNumberingConfigs,l as getWallpaper,n as uploadWallpaper,r as wallpaperSrc,o as wallpaperUploadError};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{InputNumber_default as e}from"./chunk-MIZO6SQ3.js";import{useSettingAuto as t,useInSettingRow as i}from"./chunk-E4Z5OXBI.js";import{useShellStrings as n}from"./chunk-VKMEQKYT.js";import{createContext as r,useState as l,useMemo as a,useId as o,useRef as d,useContext as s,useEffect as u,useLayoutEffect as c}from"react";import{jsx as m,jsxs as f}from"react/jsx-runtime";var p=(e,t,i)=>Math.min(i,Math.max(t,e));function h(e){const t=String(e),i=/e-(\d+)$/.exec(t);return i?Number(i[1]):t.split(".")[1]?.length??0}var v=8,x=40;function b(e){return Math.max(1,...e.map(e=>(e??"").length))}var w="undefined"==typeof window?u:c;function y(e,t,i,n){return Number(p(e,t,i).toFixed(n))}var g=r(null);function S({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 m(g.Provider,{value:r,children:e})}function z({value:r,onChange:a,min:c,max:S,step:z=1,shiftStep:F,precision:$,inputMin:k,inputMax:K,suffix:M,showInput:N=!0,emptyLabel:j,placeholderValue:L,stepFrom:E,label:A,"aria-labelledby":C,valueText:D,id:I,disabled:O,size:R="md",className:V="",auto:B}){const Q=n(),T=o(),W=t(),Z=B??W,q=o(),P=I??T,U=$??h(z),X=k??c,Y=K??S,G=void 0!==j||void 0!==L,H=E??L,J=p(r??L??c,c,S),_=d(null),[ee,te]=l(null),ie=Boolean(M);w(()=>{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,N]);const ne=e=>D?D(e):"string"==typeof M?`${e.toFixed(U)} ${M}`:void 0,re=null==r?j??(null!=L?ne(L)??String(L):void 0):ne(r),le=`calc(${b([c.toFixed(U),S.toFixed(U),r?.toFixed(U),j,L?.toFixed(U)])}ch + ${(ee?.frame??10+(ie?x:v))+2}px)`,ae=s(g),oe=o(),de=ae?.set;w(()=>{de&&de(oe,N?le:null)},[de,oe,le,N]),u(()=>()=>de?.(oe,null),[de,oe]);const se=i();/* @__PURE__ */
|
|
3
|
+
return f("div",{"data-slider":"",className:`flex w-full min-w-0 items-center ${se?"flex-wrap gap-2":"gap-3"} ${V}`.trim(),children:[
|
|
4
|
+
/* @__PURE__ */m("input",{id:P,type:"range",min:c,max:S,step:z,value:J,disabled:O,"aria-label":C?void 0:A,"aria-labelledby":C,"aria-valuetext":re,"aria-describedby":Z?q: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!=F;if(!i&&!(null==r&&null!=H))return;e.preventDefault();a(y((r??H??J)+t*(i?F??z:z),c,S,U))},onChange:e=>a(y(Number(e.target.value),c,S,U)),className:`min-w-24 flex-1 ${se?"basis-24":""} cursor-pointer accent-blue-600 disabled:cursor-not-allowed disabled:opacity-60 ${"sm"===R?"h-1":"h-1.5"}`}),N&&
|
|
5
|
+
/* @__PURE__ */m("div",{ref:_,"data-slider-box":"",className:se?"ml-auto shrink-0":"shrink-0 text-xs",style:se?void 0:{width:ae?.width??le,...ee?{fontSize:ee.fontSize}:{}},children:/* @__PURE__ */m(e,{value:r,onChange:e=>{null!=e?e<X||e>Y||a(e):G&&a(null)},min:X,max:Y,step:z,shiftStep:F,stepFrom:H,precision:U,snap:!0,allowEmpty:G,suffix:M,disabled:O,placeholder:j??(null!=L?L.toFixed(U):void 0),size:se?void 0:"sm",auto:Z,"aria-label":A?Q.slider.value(A):void 0,"aria-labelledby":A?void 0:C})}),Z&&/* @__PURE__ */m("span",{id:q,hidden:!0,children:Q.settingView.auto})]})}export{z as Slider,S as SliderGroup,y as settleSliderValue,b as sliderBoxChars,h as stepDecimals};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{arcPath as e}from"./chunk-VFC6QUEN.js";import{MOTION as t,stagger as a}from"./chunk-465RRWBY.js";import{useHighlight as l}from"./chunk-CNYAHYE6.js";import{ChartTooltip as r}from"./chunk-P5BOTIJU.js";import{angleScale as n}from"./chunk-2JWPNR2U.js";import{resolveSeriesColor as o,CHART_INK as i}from"./chunk-TZFACUMR.js";import{useShellStrings as s,useShellLocale as c}from"./chunk-
|
|
1
|
+
import{arcPath as e}from"./chunk-VFC6QUEN.js";import{MOTION as t,stagger as a}from"./chunk-465RRWBY.js";import{useHighlight as l}from"./chunk-CNYAHYE6.js";import{ChartTooltip as r}from"./chunk-P5BOTIJU.js";import{angleScale as n}from"./chunk-2JWPNR2U.js";import{resolveSeriesColor as o,CHART_INK as i}from"./chunk-TZFACUMR.js";import{useShellStrings as s,useShellLocale as c}from"./chunk-VKMEQKYT.js";import{formatPlain as m}from"./chunk-C3QOHMR6.js";import{useId as h,useState as u}from"react";import{jsx as p,jsxs as d}from"react/jsx-runtime";var f=300*Math.PI/180;function g({rows:g,variant:k="track",size:v=300,max:x,formatValue:y,animate:M=!0,className:N,emptyLabel:b,trackGap:j=6}){const C=s().charts,w=c(),T=y??(e=>m(e,w)),E=b??C.nothingToPlot,P=h(),[R,U]=u(null),{highlighted:Y}=l();if(0===g.length)/* @__PURE__ */return p("p",{className:`text-sm text-gray-500 ${N??""}`,children:E});const $=v/2,B=v/2,I=v/2-10,Q=x??Math.max(...g.map(e=>e.value),1),V="track"===k?Math.max(6,(I-.16*v)/g.length):0,z=Math.max(1,Math.floor((I-.16*v)/V||1)),A="track"===k?g.slice(0,z):g,F=Math.min(j,Math.max(1,V-2)),H=n(A.length,.03),J=null!==R?A[R]:void 0;/* @__PURE__ */
|
|
2
2
|
return d("div",{className:`relative ${N??""}`,children:[
|
|
3
3
|
/* @__PURE__ */d("svg",{width:"100%",height:v,viewBox:`0 0 ${v} ${v}`,role:"img","aria-labelledby":P,onMouseLeave:()=>U(null),children:[
|
|
4
|
-
/* @__PURE__ */p("title",{id:P,children:"track"===k?C.radialTrack(
|
|
4
|
+
/* @__PURE__ */p("title",{id:P,children:"track"===k?C.radialTrack(A.length):C.radialCycle(A.length)}),A.map((l,r)=>{const n=o(r,l.color,l.tone),s=Math.max(0,Math.min(1,l.value/Q)),c=((e,t)=>null!==R?R!==e:null!==Y&&Y!==t)(r,l.key);if("track"===k){const o=I-r*V,m=o-V+F,h=-Math.PI/2;/* @__PURE__ */
|
|
5
5
|
return d("g",{opacity:c?.4:1,onMouseEnter:()=>U(r),className:M?t.sweep:void 0,style:M?a(r,70):void 0,children:[
|
|
6
|
-
/* @__PURE__ */p("path",{d:e(B,
|
|
7
|
-
/* @__PURE__ */p("path",{d:e(B,
|
|
8
|
-
return p("g",{opacity:c?.4:1,onMouseEnter:()=>U(r),children:/* @__PURE__ */p("path",{d:e(B,
|
|
6
|
+
/* @__PURE__ */p("path",{d:e($,B,m,o,h,h+f),fill:i.grid}),
|
|
7
|
+
/* @__PURE__ */p("path",{d:e($,B,m,o,h,h+f*s),fill:n})]},l.key)}const m=.14*v;/* @__PURE__ */
|
|
8
|
+
return p("g",{opacity:c?.4:1,onMouseEnter:()=>U(r),children:/* @__PURE__ */p("path",{d:e($,B,m,m+(I-m)*s,H(r),H(r)+H.step),fill:n})},l.key)})]}),J&&null!==R&&/* @__PURE__ */p("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */p(r,{title:J.label,rows:[{key:"value",label:C.value,color:o(R,J.color,J.tone),value:T(J.value)}]})}),
|
|
9
9
|
/* @__PURE__ */p("ul",{className:"m-0 mt-3 grid gap-1 p-0",style:{gridTemplateColumns:"repeat(auto-fit,minmax(150px,1fr))"},children:g.map((e,t)=>/* @__PURE__ */d("li",{className:"flex list-none items-center gap-2 text-xs text-gray-600",children:[
|
|
10
10
|
/* @__PURE__ */p("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:o(t,e.color,e.tone)}}),
|
|
11
11
|
/* @__PURE__ */p("span",{className:"flex-1 truncate",children:e.label}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{buttonClasses as t}from"./chunk-K7U4RWXJ.js";import{SPINNER_RING as e}from"./chunk-MRJKZWWV.js";import{currentShellStrings as n}from"./chunk-
|
|
1
|
+
import{buttonClasses as t}from"./chunk-K7U4RWXJ.js";import{SPINNER_RING as e}from"./chunk-MRJKZWWV.js";import{currentShellStrings as n}from"./chunk-VKMEQKYT.js";var o="http://www.w3.org/2000/svg",s={},r=/* @__PURE__ */new Map;function i(t,e){let n=document.getElementById(t);return n||(n=document.createElement("div"),n.id=t,n.className=e,document.body.appendChild(n)),n}var a={success:"M5 13l4 4L19 7",error:"M6 18L18 6M6 6l12 12",warning:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z",info:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",bell:"M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0"};function c(t,e){const n=document.createElementNS(o,"svg");n.setAttribute("class",e),n.setAttribute("fill","none"),n.setAttribute("viewBox","0 0 24 24"),n.setAttribute("stroke","currentColor"),n.setAttribute("stroke-width","2");const s=document.createElementNS(o,"path");return s.setAttribute("stroke-linecap","round"),s.setAttribute("stroke-linejoin","round"),s.setAttribute("d",a[t]),n.appendChild(s),n}function l(t,e){const n=document.createElement("div");return n.className=t,void 0!==e&&(n.textContent=e),n}function d(n,o,a){const d={...s,...a},u=d.placement??"top",m=d.sticky??!1,p=`${u}|${n}|${o}`;if(d.dedupe){const t=r.get(p);if(t)return t.restart(),{dismiss:t.dismiss}}"loading"!==n&&!1!==d.sound&&import("./sounds-E5OTSJLX.js").then(t=>{"success"===n?t.playSuccess():"error"===n?t.playError():t.playNotification()}).catch(()=>{});const f="bottom"===u?i("toast-container-bottom","fixed bottom-4 left-1/2 -translate-x-1/2 z-(--z-toast) flex flex-col-reverse gap-2 items-center pointer-events-none"):i("toast-container","fixed top-4 left-1/2 -translate-x-1/2 z-(--z-toast) flex flex-col gap-2 items-center pointer-events-none"),h="bottom"===u?"translateY(10px)":"translateY(-10px)",y=l("pointer-events-auto cursor-pointer rosh-toast");if(y.style.opacity="0",y.style.transform=`${h} scale(0.95)`,y.setAttribute("role","error"===n?"alert":"status"),y.setAttribute("aria-atomic","true"),"loading"===n){const t=document.createElement("span");t.setAttribute("aria-hidden","true"),t.className=`${e} h-4 w-4 rosh-tone-loading`,y.appendChild(t)}else y.appendChild(c(n,`h-4 w-4 rosh-tone-${n}`));const v=document.createElement("span");if(v.textContent=o,y.appendChild(v),d.action){const{label:e,onClick:n}=d.action,o=document.createElement("button");o.type="button",o.className=t({variant:"link",size:"sm"}),o.textContent=e,o.addEventListener("click",t=>{t.stopPropagation(),g||(n(),x("action"))}),y.appendChild(o)}let b;f.appendChild(y),requestAnimationFrame(()=>{y.style.opacity="1",y.style.transform="translateY(0) scale(1)"});let g=!1;const x=t=>{g||(g=!0,b&&clearTimeout(b),r.delete(p),y.style.opacity="0",y.style.transform=`${h} scale(0.95)`,setTimeout(()=>y.remove(),300),d.onClose?.(t))},w=()=>x("dismissed"),E=d.duration??("info"===n?4500:3e3),C=()=>{b&&clearTimeout(b),m||(b=setTimeout(()=>x("timeout"),E))};return C(),y.addEventListener("mouseenter",()=>{b&&clearTimeout(b)}),y.addEventListener("mouseleave",()=>{g||C()}),y.addEventListener("click",w),r.set(p,{el:y,restart:C,dismiss:w}),{dismiss:w}}var u=8e3,m=/* @__PURE__ */new Map,p=!1;var f={success:(t,e)=>d("success",t,e),error:(t,e)=>d("error",t,e),warning:(t,e)=>d("warning",t,e),info:(t,e)=>d("info",t,e),notify:(t,e)=>function(t,e){!1!==(e?.sound??s.sound)&&import("./sounds-E5OTSJLX.js").then(t=>t.playNotification()).catch(()=>{});const o=i("notif-container","fixed top-4 right-4 z-(--z-toast) flex flex-col gap-3 items-end pointer-events-none"),r=l("pointer-events-auto cursor-pointer rosh-notif");r.style.opacity="0",r.style.transform="translateX(30px) scale(0.95)";const a=l("rosh-notif-badge");a.appendChild(c("bell","h-5 w-5"));const d=l("rosh-notif-body");d.append(l("rosh-notif-title",n().toast.notification),l("notif-msg rosh-notif-msg",t));const u=document.createElement("button");u.className="rosh-notif-close",u.textContent="×",r.append(a,d,u);const m=()=>{r.style.opacity="0",r.style.transform="translateX(30px) scale(0.95)",setTimeout(()=>r.remove(),300)};u.addEventListener("click",t=>{t.stopPropagation(),m()}),r.addEventListener("click",m),o.appendChild(r),requestAnimationFrame(()=>{r.style.opacity="1",r.style.transform="translateX(0) scale(1)"}),setTimeout(m,e?.duration??1e4)}(t,e),promise:(t,e,n)=>{const o=d("loading",e.loading,{...n,sticky:!0});return t.then(t=>{o.dismiss(),d("success","function"==typeof e.success?e.success(t):e.success,n)},t=>{o.dismiss(),d("error","function"==typeof e.error?e.error(t):e.error,n)}),t},configure:t=>{s={...t}},undoable:function(t,e){p||"undefined"==typeof window||(p=!0,window.addEventListener("pagehide",()=>{const t=[...m.values()];m.clear();for(const e of t)e.run({keepalive:!0})}));const o=/* @__PURE__ */Symbol("undoable");let s=!1,r=null;const i=async t=>{if(!s){s=!0,m.delete(o);try{await(t?e.commit(t):e.commit())}catch(t){e.onFail?.(t)}}},a=()=>!s&&(s=!0,m.delete(o),e.undo(),!0);return m.set(o,{run:i}),r=d("success",t,{sound:!1,placement:e.placement,duration:e.duration??8e3,action:{label:e.actionLabel??n().toast.undo,onClick:()=>{a()}},onClose:t=>{"action"!==t&&i()}}),{undo:()=>{const t=a();return t&&r?.dismiss(),t},commit:async()=>{if(s)return;const t=i();r?.dismiss(),await t}}}};export{u as UNDOABLE_MS,f as toast_default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{ErrorPage as r}from"./chunk-
|
|
1
|
+
import{ErrorPage as r}from"./chunk-OPFCLDVM.js";import{reportBoundaryError as e}from"./chunk-KNUR2UEG.js";import{Button_default as t}from"./chunk-4IU5BSVE.js";import{useShellStrings as s}from"./chunk-VKMEQKYT.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,9 +1,9 @@
|
|
|
1
|
-
import{toISODate as e}from"./chunk-
|
|
2
|
-
return y("input",{ref:
|
|
1
|
+
import{toISODate as e}from"./chunk-HLZZ5Q5E.js";import{Calendar as t}from"./chunk-KFSNSDTW.js";import{calendarNames as r}from"./chunk-5OTS2G3M.js";import{inputClasses as a,PLACEHOLDER_INK as n}from"./chunk-JFSYWEHD.js";import{Icon as i}from"./chunk-KIBL6M3T.js";import{onOverlayOpen as o}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as l}from"./chunk-62LW225J.js";import{useDropdownPosition as s}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as d}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as u}from"./chunk-TWVUQUUD.js";import{useShellStrings as c,useShellLocale as m}from"./chunk-VKMEQKYT.js";import{forwardRef as f,useState as b,useRef as p,useId as h,useEffect as v}from"react";import{createPortal as g}from"react-dom";import{jsx as y,jsxs as x}from"react/jsx-runtime";var N=/^\d{4}-\d{2}-\d{2}$/,k=/^(aria|data)-/,j=/* @__PURE__ */new Set(["aria-invalid","aria-required"]);function w(t){if(null==t||""===t)return"";if(t instanceof Date)return Number.isNaN(t.getTime())?"":e(t);if(N.test(t))return t;const r=new Date(t);return Number.isNaN(r.getTime())?"":e(r)}function D(e){if(!N.test(e))return null;const[t,r,a]=e.split("-").map(Number),n=new Date(t,r-1,a);return n.getMonth()===r-1&&n.getDate()===a?n:null}function F(e,t){const r=D(e);return r?t.longDate(r.getFullYear(),r.getMonth(),r.getDate()):""}var S=f(function({value:f,onChange:N,min:S,max:E,invalid:T,size:B,native:W,weekStartsOn:L,className:M="","aria-label":$,"aria-describedby":q,"aria-labelledby":C,id:I,name:O,disabled:z,placeholder:J,required:K,clearable:U,form:G,title:H,tabIndex:Q,autoFocus:Y,onFocus:P,onBlur:V,...Z},R){const A=U??!K,X=w(f),_=w(S),ee=w(E),te=c().datePicker,re=m(),ae=r(re),[ne,ie]=b(!1),oe=p(null),le=p(null),se=p(null),de=h(),ue=h(),ce=h(),me=s(le,ne,{popupRef:se}),[fe,be]=b(!1);d(()=>{const e=!!I&&(le.current?.labels?.length??0)>0;e!==fe&&be(e)});const pe=!$&&(!!C||fe);if(v(()=>{if(!ne)return;const e=e=>{const t=e.target;oe.current?.contains(t)||se.current?.contains(t)||ie(!1)};document.addEventListener("pointerdown",e,!0);const t=o(()=>ie(!1));return()=>{document.removeEventListener("pointerdown",e,!0),t()}},[ne]),v(()=>{if(ne)return u(e=>"Escape"===e.key&&(ie(!1),le.current?.focus(),!0),()=>se.current)},[ne]),W)/* @__PURE__ */
|
|
2
|
+
return y("input",{ref:R,type:"date",lang:re,id:I,name:O,disabled:z,"aria-label":$,"aria-describedby":q,"aria-invalid":T||void 0,value:X,min:_||void 0,max:ee||void 0,onChange:e=>N?.(D(e.target.value)),className:a({invalid:T,size:B,className:M}),"aria-labelledby":C,required:K,form:G,title:H,tabIndex:Q,autoFocus:Y,onFocus:P,onBlur:V,...Z});const he=Object.fromEntries(Object.entries(Z).filter(([e])=>k.test(e)&&!j.has(e))),ve=Z["aria-required"],ge=!!K||!0===ve||"true"===ve,ye=[pe?ue:void 0,ge?ce:void 0,q].filter(Boolean).join(" ")||void 0,xe=e(/* @__PURE__ */new Date),Ne=(!_||xe>=_)&&(!ee||xe<=ee),ke=J??te.placeholder;/* @__PURE__ */
|
|
3
3
|
return x("div",{ref:oe,className:"relative",children:[
|
|
4
|
-
/* @__PURE__ */y("input",{ref:
|
|
5
|
-
/* @__PURE__ */x("button",{ref:le,type:"button",...he,id:
|
|
4
|
+
/* @__PURE__ */y("input",{ref:R,type:"hidden",name:O,form:G,value:X}),
|
|
5
|
+
/* @__PURE__ */x("button",{ref:le,type:"button",...he,id:I,disabled:z,title:H,tabIndex:Q,autoFocus:Y,onFocus:P,onBlur:V,"aria-haspopup":"dialog","aria-expanded":ne,"aria-controls":ne?de:void 0,"aria-labelledby":C,"aria-describedby":ye,"aria-label":$?`${$}${X?`, ${F(X,ae)}`:""}`:void 0,onClick:()=>ie(e=>!e),className:`${a({invalid:T,size:B,className:M})} flex items-center justify-between text-left`,children:[
|
|
6
6
|
/* @__PURE__ */y("span",{className:X?"text-gray-900":"text-gray-400",children:X?F(X,ae):ke}),
|
|
7
7
|
/* @__PURE__ */y(i,{name:"date",className:`h-4 w-4 shrink-0 ${n}`,strokeWidth:"1.75","aria-hidden":"true"})]}),pe&&/* @__PURE__ */y("span",{id:ue,className:"sr-only",children:X?F(X,ae):ke}),ge&&/* @__PURE__ */y("span",{id:ce,className:"sr-only",children:te.required}),ne&&g(
|
|
8
|
-
/* @__PURE__ */x("div",{ref:se,id:de,role:"dialog","aria-label"
|
|
9
|
-
/* @__PURE__ */y(t,{value:X||null,min:_||null,max:ee||null,weekStartsOn:
|
|
8
|
+
/* @__PURE__ */x("div",{ref:se,id:de,role:"dialog","aria-label":$??te.dialog,className:"fixed w-72 rounded-xl border border-gray-200 bg-white p-3 shadow-lg",style:{zIndex:l.popup,left:me?.left,right:me?.right,top:me?.top,bottom:me?.bottom,maxWidth:me?.maxWidth,visibility:me?void 0:"hidden"},children:[
|
|
9
|
+
/* @__PURE__ */y(t,{value:X||null,min:_||null,max:ee||null,weekStartsOn:L,onSelect:e=>{ie(!1),le.current?.focus(),N?.(D(e))}}),(A||Ne)&&/* @__PURE__ */x("div",{className:"mt-2 flex justify-between border-t border-gray-100 pt-2",children:[A&&/* @__PURE__ */y("button",{type:"button",onClick:()=>{ie(!1),le.current?.focus(),N?.(null)},className:"rounded-(--radius-control) px-2 py-1 text-sm text-gray-500 hover:bg-gray-100 hover:text-gray-700",children:te.clear}),Ne&&/* @__PURE__ */y("button",{type:"button",onClick:()=>{ie(!1),le.current?.focus(),N?.(/* @__PURE__ */new Date)},className:"ml-auto rounded-(--radius-control) px-2 py-1 text-sm font-medium text-blue-600 hover:bg-blue-50",children:te.today})]})]}),document.body)]})});export{S as DatePicker_default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{inputClasses as t}from"./chunk-JFSYWEHD.js";import{useShellLocale as e}from"./chunk-
|
|
1
|
+
import{inputClasses as t}from"./chunk-JFSYWEHD.js";import{useShellLocale as e}from"./chunk-VKMEQKYT.js";import{forwardRef as n}from"react";import{jsx as a}from"react/jsx-runtime";var r=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(:\d{2})?$/,i=t=>String(t).padStart(2,"0");function l(t){return null==t||""===t?"":t instanceof Date?Number.isNaN(t.getTime())?"":`${(e=t).getFullYear()}-${i(e.getMonth()+1)}-${i(e.getDate())}T${i(e.getHours())}:${i(e.getMinutes())}`:r.test(t)?t:"";var e}var o=n(function({value:n,onChange:i,min:o,max:u,invalid:m,size:s,className:c="",...d},g){const p=e();/* @__PURE__ */
|
|
2
2
|
return a("input",{ref:g,type:"datetime-local",lang:p,"aria-invalid":m||void 0,value:l(n),min:l(o)||void 0,max:l(u)||void 0,onChange:t=>i?.(function(t){if(!r.test(t))return null;const[e,n]=t.split("T"),[a,i,l]=e.split("-").map(Number),[o,u,m=0]=n.split(":").map(Number);if(o>23||u>59||m>59)return null;const s=new Date(a,i-1,l,o,u,m);return s.getMonth()===i-1&&s.getDate()===l?s:null}(t.target.value)),className:t({invalid:m,size:s,className:c}),...d})});export{o as DateTimePicker_default};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import{LoadingSpinner as e}from"./chunk-Q5MD3VY6.js";import{useBrowserLayoutEffect as n}from"./chunk-D65T4H6J.js";import{useShellStrings as t,useShellLocale as r}from"./chunk-
|
|
2
|
-
return u("div",{className:"group flex flex-col w-72 shrink-0 rounded-xl bg-gray-50 border transition-colors "+(t?"border-blue-400 ring-2 ring-blue-300/60":"border-gray-200"),onDragOver:e=>{e.preventDefault();try{e.dataTransfer.dropEffect="move"}catch{}},onDrop:n=>{n.preventDefault(),(e=>{if(O
|
|
1
|
+
import{LoadingSpinner as e}from"./chunk-Q5MD3VY6.js";import{useBrowserLayoutEffect as n}from"./chunk-D65T4H6J.js";import{useShellStrings as t,useShellLocale as r}from"./chunk-VKMEQKYT.js";import{formatPlain as a}from"./chunk-C3QOHMR6.js";import{useState as o,useMemo as l,useRef as i,Fragment as s}from"react";import{jsx as d,Fragment as c,jsxs as u}from"react/jsx-runtime";function m({items:m,columns:f,columnOf:p,getId:g,onMove:h,renderCard:x,onCardClick:y,sortInColumn:b,isLoading:v=!1,loadingText:N,emptyState:w,showColumnsWhenEmpty:k=!1,columnEmptyText:C,onAddItem:D,addItemText:E}){const j=t().kanban,I=r(),T=N??j.loading,M=C??j.dropHere,A=E??j.addItem,[O,$]=o(null),[H,Q]=o(null),S=l(()=>{const e={};for(const n of f)e[n.value]=[];for(const n of m)(e[p(n)]??=[]).push(n);if(b)for(const n of Object.keys(e))e[n].sort(b);return e},[m,f,p,b]),q=()=>{$(null),Q(null)},z=i(null),F=i(/* @__PURE__ */new Map);n(()=>{if(null!==O)return;const e=z.current;if(!e)return;const n=/* @__PURE__ */new Map,t=[];if(e.querySelectorAll("[data-kanban-card]").forEach(e=>{const r=e.dataset.kanbanCard,a=e.getBoundingClientRect();n.set(r,a);const o=F.current.get(r);if(o){const n=o.left-a.left,r=o.top-a.top;(n||r)&&t.push([e,n,r])}}),F.current=n,t.length){for(const[e,n,r]of t)e.style.transition="none",e.style.transform=`translate(${n}px, ${r}px)`;requestAnimationFrame(()=>{for(const[e]of t)e.style.transition="transform 200ms cubic-bezier(0.2, 0, 0, 1)",e.style.transform="",e.addEventListener("transitionend",()=>{e.style.transition="",e.style.transform=""},{once:!0})})}},[S,O]);return v?/* @__PURE__ */d(e,{size:"sm",padding:"p-4",label:T}):0!==m.length||k?/* @__PURE__ */d("div",{ref:z,className:"flex-1 overflow-x-auto grid-scroll",children:/* @__PURE__ */d("div",{className:"flex gap-3 h-full min-w-max pb-2",children:f.map(e=>{const n=S[e.value]??[],t=null!==H&&H.col===e.value,r=null!==O?n.findIndex(e=>g(e)===O):-1,o=t&&(-1===r||H.index!==r&&H.index!==r+1)?H.index:-1;/* @__PURE__ */
|
|
2
|
+
return u("div",{className:"group flex flex-col w-72 shrink-0 rounded-xl bg-gray-50 border transition-colors "+(t?"border-blue-400 ring-2 ring-blue-300/60":"border-gray-200"),onDragOver:e=>{e.preventDefault();try{e.dataTransfer.dropEffect="move"}catch{}},onDrop:n=>{n.preventDefault(),(e=>{if(O&&H&&H.col===e){const n=(S[e]??[]).findIndex(e=>g(e)===O),t=-1!==n;if(!t||H.index!==n&&H.index!==n+1){const r=t&&H.index>n?H.index-1:H.index;h(O,e,r)}}q()})(e.value)},children:[
|
|
3
3
|
/* @__PURE__ */u("div",{className:`flex items-center justify-between px-3 py-2 rounded-t-xl text-sm font-medium ${e.accent??"text-gray-700 bg-gray-100"}`,children:[
|
|
4
4
|
/* @__PURE__ */u("span",{className:"flex items-center gap-2",children:[
|
|
5
5
|
/* @__PURE__ */d("span",{className:`h-2 w-2 rounded-full ${e.dot??"bg-gray-400"}`}),e.label]}),
|
|
6
6
|
/* @__PURE__ */d("span",{className:"text-xs opacity-70",children:a(n.length,I)})]}),
|
|
7
|
-
/* @__PURE__ */u("div",{className:"flex-1 overflow-y-auto p-2 space-y-2 min-h-[120px]",onDragEnter:()=>
|
|
7
|
+
/* @__PURE__ */u("div",{className:"flex-1 overflow-y-auto p-2 space-y-2 min-h-[120px]",onDragEnter:()=>Q(t=>t&&t.col===e.value&&t.index===n.length?t:{col:e.value,index:n.length}),children:[n.map((t,r)=>{const a=g(t),l=a===O;/* @__PURE__ */
|
|
8
8
|
return u(s,{children:[o===r&&/* @__PURE__ */d("div",{className:"h-0.5 rounded-full bg-blue-500","aria-hidden":!0}),
|
|
9
|
-
/* @__PURE__ */d("div",{"data-kanban-card":a,draggable:!0,onDragStart:e=>{
|
|
9
|
+
/* @__PURE__ */d("div",{"data-kanban-card":a,draggable:!0,onDragStart:e=>{$(a);try{e.dataTransfer.effectAllowed="move"}catch{}},onDragEnter:t=>{t.stopPropagation();const a=null!==O?n.findIndex(e=>g(e)===O):-1,o=-1!==a&&a<r?r+1:r;Q(n=>n&&n.col===e.value&&n.index===o?n:{col:e.value,index:o})},onDragEnd:q,onClick:y?()=>y(t):void 0,style:null===O?void 0:{opacity:l?.4:1,transition:"opacity 120ms ease"},className:"rounded-lg bg-white border border-gray-200 p-3 shadow-sm hover:border-blue-400 hover:shadow transition "+(y?"cursor-pointer":""),children:x(t)})]},a)}),n.length>0&&o===n.length&&/* @__PURE__ */d("div",{className:"h-0.5 rounded-full bg-blue-500","aria-hidden":!0}),0===n.length&&/* @__PURE__ */d("div",{className:"text-2xs text-center rounded-lg transition-all duration-150 "+(t?"border-2 border-dashed border-blue-300 bg-blue-50/50 text-blue-400 py-8":"text-gray-400 py-6"),children:M})]}),D&&/* @__PURE__ */d("div",{className:"p-2 pt-0",children:/* @__PURE__ */u("button",{type:"button",onClick:()=>D(e.value),className:"flex w-full items-center justify-center gap-1 rounded-lg px-2 min-h-8 py-1 text-xs font-medium text-gray-500 opacity-0 transition hover:bg-gray-100 hover:text-gray-700 focus-visible:opacity-100 group-hover:opacity-100",children:[
|
|
10
10
|
/* @__PURE__ */d("span",{"aria-hidden":!0,className:"text-sm leading-none",children:"+"}),A]})})]},e.value)})})}):/* @__PURE__ */d(c,{children:w??/* @__PURE__ */d("div",{className:"text-sm text-gray-500 p-4",children:j.empty})})}export{m as Kanban};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{ImageFocusPoint as e}from"./chunk-X7JK22X2.js";import{FormField as a}from"./chunk-MVQBVPWP.js";import{isVideoUrl as i,mediaPromptLine as t,mediaFileName as r,FilenameBadge as o,BusyOverlay as n,UploadGlyph as l,dropzoneClass as s,zoneFocusClass as c}from"./chunk-IMDLBXO3.js";import{TransferProgress as d}from"./chunk-2RJKMYON.js";import{Segmented as u}from"./chunk-N6DTTOB6.js";import{useFileIntake as m,FileIntakeAlert as h}from"./chunk-JACPHDTK.js";import{Icon as p}from"./chunk-KIBL6M3T.js";import{useShellStrings as b}from"./chunk-VKMEQKYT.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 w({value:w,onChange:L,onPick:R,onFile:C,label:F,hint:O,error:P,required:U,className:K,accept:B="image/*",maxSizeBytes:$,fit:z="cover",height:M=112,placeholder:T,cta:H,acceptHint:I,showFilename:V=!0,allowReplace:q=!0,allowRemove:D=!0,replaceLabel:J,removeLabel:X,busy:A=!1,busyLabel:Q,choosingLabel:S,pickFailedLabel:W,progress:Y,disabled:_=!1,kind:E,onKindChange:G,focus:Z,onFocusChange:ee,focusLabel:ae}){const ie=b().media,te=H??ie.cta,re=E??(/video/.test(B)&&!/image/.test(B)?"video":"image"),oe="string"==typeof X&&X?X:ie.remove,[ne,le]=g(!1),[se,ce]=g(!1),de=v(!0);f(()=>()=>{de.current=!1},[]);const ue=A||ne,me=ne&&!A?S??ie.choosing:Q??ie.uploading,he=P??(se?W??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&&L(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=_||ue,ke=!!w&&(i(w,B)||w===ve),je=T??t(B,ie),xe=J??(ke||"video"===re?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),L(a)})(e)},we=m({accept:B,maxSizeBytes:$,acceptHint:I,multiple:!1,disabled:ye,onAccept:([e])=>Ne(e)}),{dragOver:Le}=we,Re=()=>{ye||(R?pe():we.open())},Ce=w?r(w):"",Fe=!ke&&!!ee,Oe=_||!q&&!D?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:[q&&/* @__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})]}),D&&/* @__PURE__ */j("button",{type:"button","aria-label":oe,onClick:()=>{ge.current&&(URL.revokeObjectURL(ge.current),ge.current=null),fe(null),L("")},disabled:ue,className:`ml-auto w-8 shrink-0 ${N}`,children:/* @__PURE__ */j(p,{name:"trash","aria-hidden":"true",className:"h-4 w-4"})})]}),Pe=/* @__PURE__ */k("div",{...we.zoneProps,"data-media-frame":"",className:["group/media relative overflow-hidden rounded-(--radius-control) border transition-colors",Fe?"":"bg-gray-100",Le?"border-blue-500":"border-gray-200"].join(" "),style:Fe?void 0:{height:M},children:[Fe?
|
|
4
|
+
/* @__PURE__ */j(e,{value:Z??"",onChange:e=>ee?.(e),label:ae??ie.focus,image:w,hint:null,id:be,disabled:ye,className:"[&_[data-image-focus-picture]]:rounded-none [&_[data-image-focus-picture]]:border-0"}):ke?/* @__PURE__ */j("video",{src:w??void 0,muted:!0,playsInline:!0,preload:"metadata","aria-label":Ce||void 0,className:"h-full w-full",style:{objectFit:z}}):/* @__PURE__ */j("img",{src:w??void 0,alt:Ce,className:"h-full w-full",style:{objectFit:z,objectPosition:Z||void 0}}),V&&w&&/* @__PURE__ */j(o,{children:Ce}),Oe,ue&&/* @__PURE__ */j(n,{label:me,progress:Y,rounded:"rounded-md"})]}),Ue=/* @__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":U||void 0,"aria-describedby":he?`${be}-error`:O?`${be}-hint`:void 0,...we.zoneProps,className:s(Le,ye,c(ye)),style:{minHeight:M},children:ue?/* @__PURE__ */j(d,{state:"busy",verb:me,pct:Y}):/* @__PURE__ */k(x,{children:[
|
|
5
|
+
/* @__PURE__ */j("span",{className:"text-gray-400",children:/* @__PURE__ */j(l,{})}),
|
|
6
|
+
/* @__PURE__ */j("span",{className:"px-3 text-xs text-gray-500",children:je}),
|
|
7
|
+
/* @__PURE__ */j("span",{className:"text-sm font-medium text-blue-600",children:te}),I&&/* @__PURE__ */j("span",{className:"text-xs text-gray-400",children:I})]})});/* @__PURE__ */
|
|
8
|
+
return k(a,{label:F,htmlFor:be,hint:O,error:he,required:U,className:K,children:[G&&/* @__PURE__ */j("div",{"data-media-kind":"",className:"mb-2",children:/* @__PURE__ */j(u,{value:re,onChange:e=>G(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})}),w?Pe:Ue,!R&&/* @__PURE__ */j("input",{...we.inputProps}),
|
|
9
|
+
/* @__PURE__ */j(h,{rejections:we.rejections})]})}export{w as MediaUploadField};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import{Tree as e,TreeRow as l,TreeGroup as n}from"./chunk-W7ZAFS7C.js";import{ImageLightbox as a}from"./chunk-DSYIKLOK.js";import{MarqueeBox as r}from"./chunk-IC72MGON.js";import{Drawer as i}from"./chunk-BJEBOXTR.js";import{EmptyState as t}from"./chunk-5OGWWBJY.js";import{useContextMenu as o,ContextMenu as d}from"./chunk-WSODT2L5.js";import{DescriptionList as s}from"./chunk-SACUSHVN.js";import{Breadcrumbs as c}from"./chunk-WQKGBPOQ.js";import{useGridSelection as m}from"./chunk-VLKDWKVR.js";import{useMarquee as u}from"./chunk-OLFYNMTD.js";import{ROOT_KEY as h,mediaLibraryMenu as p}from"./chunk-DIZW2GZP.js";import{useMediaMoveItems as f}from"./chunk-SSOLRTVS.js";import{copyToClipboard as g}from"./chunk-VWMTQLVS.js";import{DropdownMenu as v}from"./chunk-255BENW2.js";import{MediaUploadGrid as y}from"./chunk-GTKNEJ3X.js";import{MediaUsedInList as k}from"./chunk-X2U5XB7J.js";import{NativeSelect as b}from"./chunk-PMOGQHYX.js";import{Input_default as w}from"./chunk-UNEJ2ABD.js";import{Segmented as x}from"./chunk-N6DTTOB6.js";import{Checkbox_default as N}from"./chunk-CGZBDI6C.js";import{useFileIntake as C,FileIntakeAlert as I}from"./chunk-JACPHDTK.js";import{Banner as D}from"./chunk-TJPPV7KZ.js";import{IconButton_default as S}from"./chunk-4CANQ3B3.js";import{ColoredBadge as T}from"./chunk-74HUZZPT.js";import{Button_default as j}from"./chunk-4IU5BSVE.js";import{buttonClasses as z}from"./chunk-K7U4RWXJ.js";import{Icon as F}from"./chunk-KIBL6M3T.js";import{Tooltip as O}from"./chunk-22S6LG6D.js";import{usePlotWidth as P}from"./chunk-MAFUXCPZ.js";import{useShellStrings as E}from"./chunk-VKMEQKYT.js";import{useRef as L,useMemo as A,useCallback as B,useState as K,useEffect as M}from"react";import{jsxs as U,Fragment as R,jsx as W}from"react/jsx-runtime";var V="application/x-efficient-media-files",G="application/x-efficient-media-folder",J={type:"all",use:"any",sort:"newest"},Z={lock:/* @__PURE__ */W(F,{name:"lock","aria-hidden":"true",className:"h-4 w-4"}),folder:/* @__PURE__ */W(F,{name:"folder","aria-hidden":"true",className:"h-4 w-4"}),folderOpen:/* @__PURE__ */W(F,{name:"folder-open","aria-hidden":"true",className:"h-4 w-4"}),folderPlus:/* @__PURE__ */W(F,{name:"folder-plus","aria-hidden":"true",className:"h-4 w-4"}),trash:/* @__PURE__ */W(F,{name:"trash","aria-hidden":"true",className:"h-4 w-4"}),upload:/* @__PURE__ */W(F,{name:"upload","aria-hidden":"true",className:"h-4 w-4"}),search:/* @__PURE__ */W(F,{name:"search","aria-hidden":"true",className:"h-4 w-4"}),grid:/* @__PURE__ */W(F,{name:"grid","aria-hidden":"true",className:"h-4 w-4"}),list:/* @__PURE__ */W(F,{name:"list","aria-hidden":"true",className:"h-4 w-4"}),more:/* @__PURE__ */W(F,{name:"more","aria-hidden":"true",className:"h-4 w-4"}),copy:/* @__PURE__ */W(F,{name:"copy","aria-hidden":"true",className:"h-4 w-4"}),edit:/* @__PURE__ */W(F,{name:"edit","aria-hidden":"true",className:"h-4 w-4"}),swap:/* @__PURE__ */W(F,{name:"swap","aria-hidden":"true",className:"h-4 w-4"}),crop:/* @__PURE__ */W(F,{name:"crop","aria-hidden":"true",className:"h-4 w-4"}),external:/* @__PURE__ */W(F,{name:"external","aria-hidden":"true",className:"h-4 w-4"}),undo:/* @__PURE__ */W(F,{name:"undo","aria-hidden":"true",className:"h-4 w-4"})},H={link:/* @__PURE__ */W(F,{name:"link","aria-hidden":"true",className:"h-3 w-3"}),email:/* @__PURE__ */W(F,{name:"email","aria-hidden":"true",className:"h-3 w-3"}),lock:/* @__PURE__ */W(F,{name:"lock","aria-hidden":"true",className:"h-3 w-3"}),clock:/* @__PURE__ */W(F,{name:"clock","aria-hidden":"true",className:"h-3 w-3"})};function Q({value:e,label:l,onDone:n}){const[a,r]=K(e),i=L(!1),t=e=>{i.current||(i.current=!0,n(e))};/* @__PURE__ */
|
|
2
|
+
return W(w,{size:"sm",autoFocus:!0,"aria-label":l,value:a,onChange:e=>r(e.target.value),onFocus:e=>e.currentTarget.select(),onKeyDown:l=>{l.stopPropagation(),"Enter"===l.key?(l.preventDefault(),t(a.trim()||e)):"Escape"===l.key&&(l.preventDefault(),t(null))},onBlur:()=>t(a.trim()||e),onClick:e=>e.stopPropagation()})}function X(F){const{mode:X="manage",layout:$="auto",location:Y,onLocationChange:q,folders:_,products:ee,allFilesCount:le,trashCount:ne,files:ae,query:re,onQueryChange:ie,filters:te=J,onFiltersChange:oe,extraFilters:de,view:se="grid",onViewChange:ce,selectedIds:me,onSelectionChange:ue,usedIn:he,denied:pe={},accept:fe="image/*,video/*",maxSizeBytes:ge,busy:ve,progress:ye,onUpload:ke,onNewFolder:be,onRename:we,onMove:xe,onTrash:Ne,onDeleteFolder:Ce,onRestore:Ie,onDeleteForever:De,onEmptyTrash:Se,onReplace:Te,onCropEdit:je,onOpenInDesign:ze,onChoose:Fe,onCancel:Oe,pickNote:Pe,className:Ee=""}=F,Le=E().mediaLibrary,Ae=E().media,Be="pick"===X,Ke=!Be,Me=L(null),Ue=P(Me,"phone"===$?343:1200),Re="phone"===$||"auto"===$&&Ue<640,We=A(()=>function(e=[]){const l=/* @__PURE__ */new Map,n=(e,a)=>{for(const r of e){const e=[...a,r];l.set(r.id,{node:r,path:e}),r.children&&n(r.children,e)}};return n(e,[]),l}(ee),[ee]),Ve=A(()=>new Map(_.map(e=>[e.id,e])),[_]),Ge=A(()=>{const e=/* @__PURE__ */new Map;for(const l of _){const n=l.parentId&&Ve.has(l.parentId)?l.parentId:null;e.set(n,[...e.get(n)??[],l])}return e},[_,Ve]),Je=B(e=>{const l=[];for(let n=e?Ve.get(e):void 0;n&&(l.unshift(n),!(l.length>_.length));n=n.parentId?Ve.get(n.parentId):void 0);return l},[Ve,_.length]),Ze=B((e,l)=>Je(e).some(e=>e.id===l),[Je]),[He,Qe]=K(()=>/* @__PURE__ */new Set(["@files"])),Xe=e=>Qe(l=>{const n=new Set(l);return n.has(e)?n.delete(e):n.add(e),n}),$e=B(e=>{Qe(l=>e.every(e=>l.has(e))?l:/* @__PURE__ */new Set([...l,...e]))},[]),Ye="files"===(qe=Y).place?`files:${qe.folderId??""}`:"products"===qe.place?`products:${qe.nodeId??""}`:"trash";var qe;M(()=>{if("files"===Y.place)$e(["@files",...Je(Y.folderId).slice(0,-1).map(e=>e.id)]);else if("products"===Y.place){const e=Y.nodeId?We.get(Y.nodeId)?.path??[]:[];$e(["@products",...e.slice(0,-1).map(e=>`p:${e.id}`)])}},[Ye]);const _e="products"===Y.place,el="trash"===Y.place,ll="files"===Y.place,nl=ll?Y.folderId:null,al=_e&&Y.nodeId?We.get(Y.nodeId)?.path[0]:void 0,rl=e=>e?.sharedFrom?`${Le.readOnly} ${Le.editedAtHq(e.sharedFrom)}`:Le.readOnly,il=A(()=>ae.map(e=>e.id),[ae]),tl=A(()=>new Map(ae.map(e=>[e.id,e])),[ae]),ol=m(il),dl=A(()=>il.filter(e=>ol.selected.has(e)),[il,ol.selected]),sl=1===dl.length?tl.get(dl[0]):void 0,cl=L(!0);M(()=>{cl.current?cl.current=!1:ol.clear()},[Ye]);const ml=me?.join("\0");M(()=>{me&&ol.setSelection(me)},[ml]);const ul=L(ml??""),hl=dl.join("\0");M(()=>{ul.current!==hl&&(ul.current=hl,ue?.(dl))},[hl]);const pl=(e,l={})=>{Be?ol.select(e):ol.select(e,{ctrl:!(!l.ctrlKey&&!l.metaKey),shift:!!l.shiftKey})},[fl,gl]=K(null),vl=e=>{const l=fl;if(gl(null),!l||null==e)return;e!==("folder"===l.kind?Ve.get(l.id)?.name:tl.get(l.id)?.name)&&we?.(l,e)},yl=async e=>{if(!be)return;const l=await be(e);$e(["@files",...e?[e]:[]]),"string"==typeof l&&gl({kind:"folder",id:l})},kl=B(e=>{const l=[],n=l=>{if("files"===e.kind)return l===nl&&ll?Le.alreadyHere:void 0;const n=Ve.get(e.id);return l===e.id||l&&Ze(l,e.id)?Le.notIntoItself:(n?.parentId??null)===l?Le.folderAlreadyHere:void 0};l.push({key:h,label:Le.allFiles,disabledReason:n(null)});const a=(e,r)=>{for(const i of Ge.get(e)??[])l.push({key:i.id,label:i.name,depth:r,disabledReason:n(i.id)}),a(i.id,r+1)};return a(null,1),l},[Ge,Ve,ll,Ze,nl,Le]),bl=B(e=>{const l=new Set(e.map(e=>tl.get(e)?.kind??"image"));return 1===l.size?[...l][0]:"file"},[tl]),[wl,xl]=K(null),Nl={words:Le,media:Ae,denied:pe,moveTargets:kl,kindOf:bl,urlOf:e=>tl.get(e)?.url,newSubfolder:be&&Ke?e=>{yl(e)}:void 0,rename:we&&Ke?e=>{"file"!==e.kind||ol.isSelected(e.id)||ol.select(e.id),gl(e)}:void 0,move:xe&&Ke?xe:void 0,trash:Ne&&Ke?Ne:void 0,deleteFolder:Ce&&Ke?Ce:void 0,folderNotEmpty:e=>!!Ve.get(e)?.notEmpty,replace:Te&&Ke?Te:void 0,copyUrl:e=>{const l=tl.get(e)?.url;l&&g(Le.urlLabel,l)},openInDesign:ze,restore:Ie,deleteForever:De},Cl=e=>p(e,Nl),Il=o(),Dl=(e,l)=>{Be||(ol.isSelected(e)||ol.select(e),Il.open(l,(e=>{const l=ol.isSelected(e)?dl:[e];return _e?{kind:"render",id:e}:el?{kind:"trashed",ids:l}:{kind:"files",ids:l}})(e)))},[Sl,Tl]=K(null),[jl,zl]=K(null),[Fl,Ol]=K(null);M(()=>{if(!jl&&!Sl)return;const e=()=>{zl(null),Tl(null)};return window.addEventListener("dragend",e),window.addEventListener("drop",e),()=>{window.removeEventListener("dragend",e),window.removeEventListener("drop",e)}},[jl,Sl]);const Pl=(e,l)=>Array.from(e.dataTransfer?.types??[]).includes(l),El=(e,l)=>!(!xe||pe.move||Be)&&(!!Pl(e,V)||!(!Pl(e,G)||!Fl)&&(l!==Fl&&!(l&&Ze(l,Fl)))),Ll=(e,l)=>({onDragEnter:n=>{El(n,l)&&(n.preventDefault(),Tl(e))},onDragOver:n=>{El(n,l)&&(n.preventDefault(),n.dataTransfer.dropEffect="move",Sl!==e&&Tl(e))},onDragLeave:l=>{const n=l.relatedTarget;n&&l.currentTarget.contains(n)||Tl(l=>l===e?null:l)},onDrop:e=>{if(El(e,l))if(e.preventDefault(),Tl(null),Pl(e,V)){let n;try{n=JSON.parse(e.dataTransfer.getData(V))}catch{n=null}Array.isArray(n)&&n.length&&xe({kind:"files",ids:n.map(String)},l)}else Fl&&(xe({kind:"folder",id:Fl},l),Ol(null))}}),Al=e=>{const l=e=>Pl(e,V)||Pl(e,G)||Pl(e,"Files");return{onDragEnter:n=>{l(n)&&zl(e)},onDragOver:n=>{l(n)&&jl!==e&&zl(e)},onDragLeave:l=>{const n=l.relatedTarget;n&&l.currentTarget.contains(n)||zl(l=>l===e?null:l)}}},Bl=(e,l,n)=>/* @__PURE__ */W(O,{side:"right",content:jl===e?Le.noDropProducts:rl(n),open:jl===e||!jl&&void 0,children:/* @__PURE__ */W("span",{children:l})}),Kl=e=>({onContextMenu:l=>{Il.open(l,e)}}),Ml=(e,a,r)=>e.map(e=>{const i=`p:${e.id}`,t=r??e,o=He.has(i),d=e.children?.length?e.children:null;/* @__PURE__ */
|
|
3
|
+
return U("div",{role:"none",className:"contents",children:[
|
|
4
|
+
/* @__PURE__ */W(l,{label:Bl(i,e.name,t),level:a,icon:d&&o?Z.folderOpen:Z.folder,badge:null!=e.count?e.count:void 0,selected:_e&&Y.nodeId===e.id,expanded:d?o:void 0,onToggle:d?()=>Xe(i):void 0,onSelect:()=>q({place:"products",nodeId:e.id}),rowProps:{"data-media-row":i,...Al(i),...Ke?Kl({kind:"product-node",id:e.id}):{}}}),d&&o&&/* @__PURE__ */W(n,{children:Ml(d,a+1,t)})]},e.id)}),Ul=(e,a)=>(Ge.get(e)??[]).map(e=>{const r=Ge.get(e.id),i=He.has(e.id),t="folder"===fl?.kind&&fl.id===e.id,o=Cl({kind:"folder",id:e.id});/* @__PURE__ */
|
|
5
|
+
return U("div",{role:"none",className:"contents",children:[
|
|
6
|
+
/* @__PURE__ */W(l,{label:e.name,level:a,icon:r&&i?Z.folderOpen:Z.folder,badge:null!=e.count?e.count:void 0,selected:t||ll&&Y.folderId===e.id,expanded:r?i:void 0,onToggle:r?()=>Xe(e.id):void 0,onSelect:()=>q({place:"files",folderId:e.id}),drop:Sl===e.id?"into":void 0,dragging:Fl===e.id,draggable:Ke&&!!xe&&!pe.move,rename:t?/* @__PURE__ */W(Q,{value:e.name,label:Le.folderName,onDone:vl}):void 0,actions:Ke&&o.length?/* @__PURE__ */W(v,{align:"end","aria-label":Le.folderActions,trigger:Z.more,items:o}):void 0,rowProps:{"data-media-row":e.id,...Ll(e.id,e.id),...Ke?Kl({kind:"folder",id:e.id}):{},...Ke&&xe&&!pe.move?{draggable:!0,onDragStart:l=>{l.dataTransfer.effectAllowed="move",l.dataTransfer.setData(G,e.id),Ol(e.id)},onDragEnd:()=>{Ol(null),Tl(null)}}:{}}}),r&&i&&/* @__PURE__ */W(n,{children:Ul(e.id,a+1)})]},e.id)}),Rl=He.has("@files"),Wl=He.has("@products"),Vl=/* @__PURE__ */U(e,{"aria-label":Le.folders,children:[ee&&/* @__PURE__ */U(R,{children:[
|
|
7
|
+
/* @__PURE__ */W(l,{label:Bl("@products",Le.products),level:1,icon:Z.lock,badge:{label:Le.readOnlyBadge,tone:"neutral"},expanded:ee.length?Wl:void 0,onToggle:()=>Xe("@products"),selected:_e&&null==Y.nodeId,onSelect:()=>q({place:"products",nodeId:null}),rowProps:{"data-media-row":"@products",...Al("@products")}}),Wl&&ee.length>0&&/* @__PURE__ */W(n,{children:Ml(ee,2)})]}),
|
|
8
|
+
/* @__PURE__ */W(l,{label:Le.allFiles,level:1,icon:Rl?Z.folderOpen:Z.folder,badge:null!=le?le:void 0,expanded:Ge.get(null)?.length?Rl:void 0,onToggle:()=>Xe("@files"),selected:ll&&null==Y.folderId,onSelect:()=>q({place:"files",folderId:null}),drop:"@files"===Sl?"into":void 0,rowProps:{"data-media-row":"@files",...Ll("@files",null)}}),Rl&&(Ge.get(null)?.length??0)>0&&/* @__PURE__ */W(n,{children:Ul(null,2)}),Ke&&/* @__PURE__ */W(l,{label:Le.trash,level:1,icon:Z.trash,badge:null!=ne?ne:void 0,selected:el,onSelect:()=>q({place:"trash"}),rowProps:{"data-media-row":"@trash"}})]}),Gl=(()=>{if(el)return[{label:Le.trash}];if(_e){const e=Y.nodeId?We.get(Y.nodeId)?.path??[]:[];return[{label:Le.products,onClick:e.length?()=>q({place:"products",nodeId:null}):void 0},...e.map((l,n)=>({label:l.name,onClick:n<e.length-1?()=>q({place:"products",nodeId:l.id}):void 0}))]}const e=Je(nl);return[{label:Le.allFiles,onClick:e.length?()=>q({place:"files",folderId:null}):void 0},...e.map((l,n)=>({label:l.name,onClick:n<e.length-1?()=>q({place:"files",folderId:l.id}):void 0}))]})(),Jl=_e?Le.readOnly:pe.upload,Zl=!!ke&&!el&&!Jl,Hl=C({accept:fe,maxSizeBytes:ge,multiple:!0,disabled:!Zl,onAccept:e=>ke?.(e,nl)}),Ql=_e?Le.noProductFolder:pe.newFolder,Xl=e=>e?{"aria-disabled":!0,disabledReason:e}:{},$l=/* @__PURE__ */U("div",{className:"flex flex-wrap items-center gap-2",children:[Ke&&be&&!el&&/* @__PURE__ */W(j,{variant:"secondary",size:"sm",leftIcon:Z.folderPlus,onClick:()=>{yl(nl)},...Xl(Ql),children:Le.newFolder}),ke&&!el&&/* @__PURE__ */W(j,{variant:"primary",size:"sm",leftIcon:Z.upload,onClick:()=>Hl.open(),...Xl(Jl),children:Le.upload}),Ke&&el&&Se&&ae.length>0&&/* @__PURE__ */W(j,{variant:"danger",size:"sm",onClick:Se,...Xl(pe.deleteForever),children:Le.emptyTrash})]}),Yl=(e,l,n,a,r)=>/* @__PURE__ */W("div",{style:{width:Re?void 0:r,flex:Re?"1 1 120px":"0 0 auto",minWidth:0},children:/* @__PURE__ */W(b,{size:"sm","aria-label":e,value:l,onChange:a,options:n})},e),ql=e=>l=>oe?.({...te,[e]:l}),_l=/* @__PURE__ */U("div",{className:"flex flex-wrap items-center gap-2",children:[ie&&/* @__PURE__ */W("div",{style:{flex:"1 1 200px",minWidth:0},children:/* @__PURE__ */W(w,{size:"sm",type:"search",leftIcon:Z.search,placeholder:_e?Le.searchProducts:Le.search,"aria-label":_e?Le.searchProducts:Le.search,value:re??"",onChange:e=>ie(e.target.value)})}),oe&&Yl(Le.mediaType,te.type,[{value:"all",label:Le.allTypes},{value:"image",label:Le.images},{value:"video",label:Le.videos},{value:"svg",label:"SVG"},{value:"gif",label:"GIF"}],ql("type"),130),oe&&!_e&&!el&&Yl(Le.use,te.use,[{value:"any",label:Le.anyUse},{value:"email",label:Le.emailOnly},{value:"website",label:Le.websiteOnly},{value:"unused",label:Le.notUsed}],ql("use"),130),oe&&Ke&&Yl(Le.sort,te.sort,[{value:"newest",label:Le.newest},{value:"name",label:Le.byName},{value:"size",label:Le.bySize}],ql("sort"),110),de?.map(e=>Yl(e.label,e.value,e.options,e.onChange,120)),ce&&/* @__PURE__ */W(x,{size:"sm",label:Le.view,value:se,onChange:ce,options:[{value:"grid",label:Le.grid,icon:Z.grid},{value:"list",label:Le.list,icon:Z.list}]})]}),en=e=>{const l=[];return null!=e.trashedDaysAgo&&l.push({key:"t",label:Le.daysAgo(e.trashedDaysAgo),count:e.trashedDaysAgo,icon:H.clock,tone:"neutral"}),e.usedCount&&l.push({key:"u",label:Le.used(e.usedCount),count:e.usedCount,icon:H.link,tone:"active"}),e.email&&l.push({key:"e",label:Le.email,icon:H.email,tone:"queued"}),e.private&&l.push({key:"p",label:Le.private,icon:H.lock,tone:"neutral"}),l},ln=e=>en(e).map(e=>/* @__PURE__ */W(T,{tone:e.tone,size:"xs",children:e.label},e.key)),nn=Ke&&ll&&!!xe&&!pe.move,an=ae.map(e=>({id:e.id,url:e.thumbUrl??e.url,name:e.name,kind:e.kind,caption:e.name,badges:en(e),dragData:nn?JSON.stringify(ol.isSelected(e.id)?dl:[e.id]):void 0})),rn=Re?Math.max(72,Math.floor((Ue-24-16-1)/3)):112,tn=L(null),on=u({containerRef:tn,enabled:Ke&&!Re&&ae.length>0,selected:ol.selected,setSelection:e=>ol.setSelection(e),clearSelection:ol.clear}),dn=e=>{if(Be){const l=tl.get(e);return void(!l||l.private||l.pickDisabledReason||Fe?.(l))}const l=il.indexOf(e);l>=0&&xl(l)},sn=ae.length?null:re?/* @__PURE__ */W(t,{variant:"dashed",title:Le.noMatches}):_e?/* @__PURE__ */W(t,{variant:"dashed",title:Le.emptyProducts,description:rl(al)}):el?/* @__PURE__ */W(t,{variant:"dashed",title:Le.trashEmpty}):!Zl||Be?/* @__PURE__ */W(t,{variant:"dashed",title:Le.emptyFolder}):null,cn="list"===se&&ae.length>0,mn=sn??(cn?/* @__PURE__ */W("ul",{role:"listbox","aria-multiselectable":Ke||void 0,"aria-label":Le.folders,className:"flex flex-col gap-1",children:ae.map(e=>/* @__PURE__ */U("li",{role:"option","aria-selected":ol.isSelected(e.id),tabIndex:0,"data-grid-item":"","data-grid-id":e.id,onClick:l=>pl(e.id,l),onDoubleClick:()=>dn(e.id),onContextMenu:l=>Dl(e.id,l),onKeyDown:l=>{"Enter"!==l.key&&" "!==l.key||(l.preventDefault(),pl(e.id,l))},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)] "+(ol.isSelected(e.id)?"bg-blue-50 text-blue-700":"text-gray-700 hover:bg-gray-100"),children:[
|
|
9
|
+
/* @__PURE__ */W("img",{src:e.thumbUrl??e.url,alt:"",className:"h-10 w-10 shrink-0 rounded bg-gray-100 object-contain"}),
|
|
10
|
+
/* @__PURE__ */W("span",{className:"min-w-0 flex-1 truncate",children:e.name}),
|
|
11
|
+
/* @__PURE__ */W("span",{className:"flex shrink-0 items-center gap-1",children:ln(e)}),e.sizeLabel&&/* @__PURE__ */W("span",{className:"w-16 shrink-0 text-right text-xs text-gray-500",children:e.sizeLabel})]},e.id))}):/* @__PURE__ */W(y,{items:an,readOnly:!Zl||Be,onFiles:Zl&&!Be?e=>ke(e,nl):void 0,accept:fe,maxSizeBytes:ge,busy:ve,progress:ye,fit:"contain",thumbSize:rn,dragType:nn?V:void 0,selected:ol.selected,onItemClick:pl,onItemDoubleClick:dn,onItemContextMenu:Ke?Dl:void 0,menuOnMedia:Ke})),un=f({count:dl.length,kind:bl(dl),targets:kl({kind:"files",ids:dl}),onPick:e=>xe?.({kind:"files",ids:dl},e.key===h?null:e.key)}),hn=z({variant:"secondary",size:"sm"}),pn=/* @__PURE__ */W(v,{align:"start",triggerClassName:hn,trigger:/* @__PURE__ */U(R,{children:[Z.folder,Le.moveTo]}),items:un,disabled:!!pe.move}),fn=Ke&&dl.length>1&&!_e?/* @__PURE__ */U("div",{"data-media-bulk":"",className:"flex flex-wrap items-center gap-2 rounded-lg border border-gray-200 px-3 py-2",children:[
|
|
12
|
+
/* @__PURE__ */W(N,{checked:dl.length===ae.length,indeterminate:dl.length<ae.length,onChange:e=>e?ol.selectAll():ol.clear(),label:Le.selected(dl.length)}),/* @__PURE__ */U(R,el?{children:[Ie&&/* @__PURE__ */W(j,{variant:"secondary",size:"sm",leftIcon:Z.undo,onClick:()=>Ie(dl),...Xl(pe.restore),children:Le.restore}),De&&/* @__PURE__ */W(j,{variant:"secondary-danger",size:"sm",onClick:()=>De(dl),...Xl(pe.deleteForever),children:Le.deleteForever})]}:{children:[xe&&pn,we&&/* @__PURE__ */W(j,{variant:"secondary",size:"sm",leftIcon:Z.edit,disabled:!0,children:Le.rename}),Ne&&/* @__PURE__ */W(j,{variant:"secondary",size:"sm",leftIcon:Z.trash,onClick:()=>Ne({kind:"files",ids:dl}),...Xl(pe.trash),children:Le.moveFilesToTrash(dl.length)})]}),
|
|
13
|
+
/* @__PURE__ */W(j,{variant:"ghost",size:"sm",onClick:ol.clear,children:Le.clearSelection})]}):null,gn=e=>{const l=[],n=(e,n,a)=>{null!=a&&""!==a&&l.push({key:e,label:n,value:a})},a="file"===fl?.kind&&fl.id===e.id;n("name",Le.name,a?/* @__PURE__ */W(Q,{value:e.name,label:Le.fileName,onDone:vl}):e.name),n("type",Le.type,e.typeLabel),n("size",Le.size,e.sizeLabel),n("resolution",Le.resolution,e.resolution),_e?(n("design",Le.design,e.design),n("finish",Le.finish,e.finish),n("angle",Le.angleLug,e.angleLug),n("owner",Le.owner,e.owner)):(n("added",Le.addedBy,e.addedBy),n("folder",Le.folder,e.folderPath)),n("used",Le.usedIn,null!=e.usedCount?Le.places(e.usedCount):void 0);const r=p({kind:"files",ids:[e.id]},Nl).find(e=>"submenu"===e.type);/* @__PURE__ */
|
|
14
|
+
return U("div",{"data-media-details":"",className:"flex flex-col gap-3",children:[
|
|
15
|
+
/* @__PURE__ */W("img",{src:e.url,alt:e.name,className:"aspect-square w-full rounded-lg bg-gray-100 object-contain"}),_e&&/* @__PURE__ */W(D,{tone:"neutral",title:Le.readOnlyBadge,children:rl(al)}),
|
|
16
|
+
/* @__PURE__ */W(s,{size:"sm",columns:1,items:l}),!el&&/* @__PURE__ */U("div",{className:"flex gap-2",children:[
|
|
17
|
+
/* @__PURE__ */W("div",{style:{flex:"1 1 0",minWidth:0},children:/* @__PURE__ */W(w,{size:"sm",readOnly:!0,value:e.url,"aria-label":Le.fileUrl,onFocus:e=>e.currentTarget.select()})}),
|
|
18
|
+
/* @__PURE__ */W(j,{variant:"secondary",size:"sm",leftIcon:Z.copy,onClick:()=>Nl.copyUrl(e.id),children:Le.copyUrl})]}),ll&&Ke&&/* @__PURE__ */U("div",{className:"flex flex-wrap gap-2",children:[Te&&/* @__PURE__ */W(j,{variant:"secondary",size:"sm",leftIcon:Z.swap,onClick:()=>Te(e.id),...Xl(pe.replace),children:Le.replace}),je&&/* @__PURE__ */W(j,{variant:"secondary",size:"sm",leftIcon:Z.crop,onClick:()=>je(e.id),children:Le.cropEdit}),xe&&"submenu"===r?.type&&/* @__PURE__ */W(v,{align:"start",triggerClassName:hn,trigger:/* @__PURE__ */U(R,{children:[Z.folder,Le.moveTo]}),items:r.items,disabled:!!pe.move}),we&&/* @__PURE__ */W(j,{variant:"secondary",size:"sm",leftIcon:Z.edit,onClick:()=>gl({kind:"file",id:e.id}),...Xl(pe.rename),children:Le.rename}),Ne&&/* @__PURE__ */W(S,{"aria-label":Le.moveToTrash,size:"sm",onClick:()=>Ne({kind:"files",ids:[e.id]}),disabledReason:pe.trash,"aria-disabled":!!pe.trash||void 0,children:Z.trash})]}),el&&Ke&&/* @__PURE__ */U("div",{className:"flex flex-wrap gap-2",children:[Ie&&/* @__PURE__ */W(j,{variant:"primary",size:"sm",leftIcon:Z.undo,onClick:()=>Ie([e.id]),...Xl(pe.restore),children:Le.restore}),De&&/* @__PURE__ */W(j,{variant:"danger",size:"sm",onClick:()=>De([e.id]),...Xl(pe.deleteForever),children:Le.deleteForever})]}),_e&&ze&&/* @__PURE__ */W(j,{variant:"secondary",size:"sm",leftIcon:Z.external,onClick:()=>ze({kind:"render",id:e.id}),children:Le.openInDesign}),he&&/* @__PURE__ */W(k,{items:he})]})},vn=sl?sl.private?Le.privateNoPick:sl.pickDisabledReason:void 0,yn=Be?/* @__PURE__ */U("div",{"data-media-picker-footer":"",className:"flex flex-wrap items-center justify-between gap-2 border-t border-gray-200 px-3 py-2",children:[
|
|
19
|
+
/* @__PURE__ */W("span",{className:"min-w-0 truncate text-sm text-gray-500",children:sl?Le.oneChosen(sl.name):Le.noneChosen}),
|
|
20
|
+
/* @__PURE__ */U("div",{className:"flex gap-2",children:[Oe&&/* @__PURE__ */W(j,{variant:"secondary",size:"sm",onClick:Oe,children:Le.cancel}),
|
|
21
|
+
/* @__PURE__ */W(j,{variant:"primary",size:"sm",disabled:!sl,...Xl(vn),onClick:()=>{sl&&!vn&&Fe?.(sl)},children:Le.chooseImage})]})]}):null,kn=Ke&&!!sl,bn=/* @__PURE__ */U("div",{className:"flex min-w-0 flex-col gap-3",children:[Pe&&/* @__PURE__ */W(D,{tone:"neutral",children:Pe}),
|
|
22
|
+
/* @__PURE__ */U("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[
|
|
23
|
+
/* @__PURE__ */W(c,{items:Gl}),$l]}),_l,fn,
|
|
24
|
+
/* @__PURE__ */U("div",{ref:tn,className:"relative",onPointerDown:on.onPointerDown,onKeyDown:e=>{Ke&&(e.ctrlKey||e.metaKey)&&"a"===e.key.toLowerCase()?(e.preventDefault(),ol.selectAll()):"Escape"===e.key&&ol.size&&ol.clear()},children:[mn,
|
|
25
|
+
/* @__PURE__ */W(r,{rect:on.rect})]}),Zl&&/* @__PURE__ */W("input",{...Hl.inputProps}),
|
|
26
|
+
/* @__PURE__ */W(I,{rejections:Hl.rejections})]});/* @__PURE__ */
|
|
27
|
+
return U("div",{ref:Me,"data-media-library":"","data-layout":Re?"phone":"wide",className:`flex h-full min-h-0 min-w-0 flex-col ${Ee}`.trim(),children:[/* @__PURE__ */U("div",Re?{className:"flex flex-col gap-3 p-3",children:[Vl,bn]}:{className:"flex min-h-0 min-w-0 flex-1",children:[
|
|
28
|
+
/* @__PURE__ */W("div",{className:"shrink-0 overflow-y-auto border-r border-gray-200 p-3",style:{width:280,"--rosh-tree-ground":"var(--surface)"},children:Vl}),
|
|
29
|
+
/* @__PURE__ */W("div",{className:"min-w-0 flex-1 overflow-y-auto p-3",children:bn}),kn&&/* @__PURE__ */W("div",{className:"shrink-0 overflow-y-auto border-l border-gray-200 p-3",style:{width:300},children:gn(sl)})]}),yn,Re&&/* @__PURE__ */W(i,{open:kn,onClose:ol.clear,side:"bottom",title:sl?.name,children:sl&&gn(sl)}),Il.state&&/* @__PURE__ */W(d,{...Il.props,items:Cl(Il.state.data)}),null!=wl&&ae.length>0&&/* @__PURE__ */W(a,{images:ae.map(e=>({url:e.url,caption:e.name})),startIndex:Math.min(wl,ae.length-1),onClose:()=>xl(null)})]})}export{V as MEDIA_FILES_DRAG_TYPE,G as MEDIA_FOLDER_DRAG_TYPE,X as MediaLibrary};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{optionMatches as e,OptionSublabel as t}from"./chunk-UQBPKZUR.js";import{inputClasses as n}from"./chunk-JFSYWEHD.js";import{GROUP_COLORS as r}from"./chunk-D323R2FT.js";import{Tooltip as o}from"./chunk-22S6LG6D.js";import{onOverlayOpen as l}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as i}from"./chunk-62LW225J.js";import{useDropdownPosition as a,POPUP_MAX_WIDTH as s,MENU_MAX_HEIGHT as c}from"./chunk-GLUJS42B.js";import{glassStyle as u}from"./chunk-DTJRIWFR.js";import{useShellStrings as d}from"./chunk-
|
|
2
|
-
return v("div",{ref:
|
|
1
|
+
import{optionMatches as e,OptionSublabel as t}from"./chunk-UQBPKZUR.js";import{inputClasses as n}from"./chunk-JFSYWEHD.js";import{GROUP_COLORS as r}from"./chunk-D323R2FT.js";import{Tooltip as o}from"./chunk-22S6LG6D.js";import{onOverlayOpen as l}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as i}from"./chunk-62LW225J.js";import{useDropdownPosition as a,POPUP_MAX_WIDTH as s,MENU_MAX_HEIGHT as c}from"./chunk-GLUJS42B.js";import{glassStyle as u}from"./chunk-DTJRIWFR.js";import{useShellStrings as d}from"./chunk-VKMEQKYT.js";import{useState as m,useRef as h,useMemo as p,useEffect as f}from"react";import{createPortal as g}from"react-dom";import{jsxs as v,jsx as x,Fragment as b}from"react/jsx-runtime";var w={accent:{chip:"inline-flex max-w-full items-center gap-1 rounded bg-blue-50 px-2 py-0.5 text-xs font-medium text-blue-700",remove:"text-blue-400 hover:text-red-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-deep)] rounded leading-none"},danger:{chip:`inline-flex max-w-full items-center gap-1 rounded ${r.danger} px-2 py-0.5 text-xs font-medium`,remove:"text-current opacity-70 hover:opacity-100 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-deep)] rounded leading-none"}};function y({value:r,onChange:y,options:k=[],placeholder:N,allowFreeText:j=!1,invalid:D,disabled:L,id:C,className:E="",tone:W,tooltip:F,split:M}){const[S,T]=m(!1),[$,B]=m(""),J=d(),K=h(null),R=h(null),G=h(null),H=a(K,S),I=e=>k.find(t=>t.value===e)?.label??e,U=p(()=>{const t=new Set(r),n=[],o=$.trim().toLowerCase();for(const r of k)t.has(r.value)||(t.add(r.value),o&&!e(r,o)||n.push(r));return n},[k,r,$]),P=e=>{const t=[...r];for(const n of e){const e=n.trim();if(!e)continue;const r=e.toLowerCase(),o=k.find(t=>t.value===e||t.label.toLowerCase()===r)?.value,l=o??(j?e:null);l&&!t.includes(l)&&t.push(l)}t.length!==r.length&&y(t)},Q=e=>{e&&!r.includes(e)?(y([...r,e]),B("")):B("")},Y=e=>y(r.filter(t=>t!==e)),z=()=>{const e=$.trim();if(M&&e)return P(e.split(M)),void B("");j&&e?Q(e):B("")},V=h(()=>{});V.current=()=>{z(),T(!1)},f(()=>{if(!S)return;const e=e=>{const t=e.target;K.current?.contains(t)||G.current?.contains(t)||(z(),T(!1))};document.addEventListener("mousedown",e);const t=l(()=>V.current());return()=>{document.removeEventListener("mousedown",e),t()}});const Z=k.length>0;/* @__PURE__ */
|
|
2
|
+
return v("div",{ref:K,className:"relative",children:[
|
|
3
3
|
/* @__PURE__ */v("div",{onMouseDown:e=>{L||e.target.closest("button")||(e.preventDefault(),R.current?.focus())},className:n({invalid:D,multiline:!0,className:`flex flex-wrap items-center gap-1 cursor-text focus-within:border-blue-400 has-focus-visible:ring-2 has-focus-visible:ring-[color:var(--rosh-focus-ring)] ${L?"bg-gray-50 cursor-not-allowed":""} ${E}`}),children:[r.map(e=>{const t=W?.(e),n=w[t??"accent"],r=/* @__PURE__ */v("span",{"data-tone":t,className:n.chip,children:[
|
|
4
|
-
/* @__PURE__ */x("span",{className:"truncate",children:
|
|
5
|
-
/* @__PURE__ */x("input",{id:C,ref:R,type:"text",autoComplete:"off",role:"combobox","aria-expanded":
|
|
6
|
-
/* @__PURE__ */x("div",{ref:
|
|
4
|
+
/* @__PURE__ */x("span",{className:"truncate",children:I(e)}),!L&&/* @__PURE__ */x("button",{type:"button","aria-label":J.select.removeItem?.(I(e))??`${J.select.remove} ${I(e)}`,onClick:()=>Y(e),className:n.remove,children:"×"})]},e),l=F?.(e);return null==l?r:/* @__PURE__ */x(o,{content:l,className:"relative inline-flex max-w-full",children:r},e)}),
|
|
5
|
+
/* @__PURE__ */x("input",{id:C,ref:R,type:"text",autoComplete:"off",role:"combobox","aria-expanded":S&&Z,"aria-invalid":D||void 0,disabled:L,value:$,placeholder:0===r.length?N:void 0,onChange:e=>{(e=>{if(M){const t=e.split(M);if(t.length>1)return P(t.slice(0,-1)),void B(t[t.length-1])}B(e)})(e.target.value),T(!0)},onFocus:()=>{!L&&Z&&T(!0)},onKeyDown:t=>{if("Enter"===t.key||","===t.key&&j){t.preventDefault();const n=$.trim(),r=n?U.filter(t=>e(t,n.toLowerCase())):[];1===r.length?Q(r[0].value):z()}else"Backspace"===t.key&&""===$&&r.length>0?Y(r[r.length-1]):"Escape"===t.key?(T(!1),B(""),R.current?.blur()):"Tab"===t.key&&(z(),T(!1))},className:"min-w-[8ch] flex-1 border-none bg-transparent p-0 text-sm text-gray-800 placeholder:text-gray-400 rosh-focus-ring focus-visible:ring-0 disabled:cursor-not-allowed"})]}),S&&Z&&g(
|
|
6
|
+
/* @__PURE__ */x("div",{ref:G,className:"fixed rounded-(--radius-popup) overflow-hidden",style:{zIndex:i.popup,left:H?.left,right:H?.right,top:H?.top,bottom:H?.bottom,minWidth:H?.minWidth,maxWidth:H?.maxWidth??s,width:"max-content",visibility:H?void 0:"hidden",...u()},children:/* @__PURE__ */x("div",{className:"overflow-y-auto",style:{maxHeight:H?.maxHeight??c},children:0===U.length?/* @__PURE__ */x("p",{className:"px-3 py-3 text-sm text-gray-400 text-center",children:k.length>0&&r.length>=k.length?J.select.allSelected:J.select.noMatches}):U.map(e=>/* @__PURE__ */x("button",{type:"button",onMouseDown:t=>{t.preventDefault(),Q(e.value)},className:e.sublabel?"w-full text-left px-3 min-h-(--row-height-menu) py-2 text-sm hover:bg-gray-50 text-gray-700 whitespace-nowrap flex items-center justify-between gap-3":"w-full text-left px-3 min-h-(--row-height-menu) py-2 leading-5 text-sm hover:bg-gray-50 text-gray-700 whitespace-nowrap",children:e.sublabel?/* @__PURE__ */v(b,{children:[
|
|
7
7
|
/* @__PURE__ */x("span",{className:"min-w-0 truncate",children:e.label}),
|
|
8
8
|
/* @__PURE__ */x(t,{grows:!0,children:e.sublabel})]}):e.label},e.value))})}),document.body)]})}export{y as TagInput};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{Icon as e}from"./chunk-KIBL6M3T.js";import{useShellStrings as t}from"./chunk-
|
|
1
|
+
import{Icon as e}from"./chunk-KIBL6M3T.js";import{useShellStrings as t}from"./chunk-VKMEQKYT.js";import{useState as r,useRef as o,useEffect as c,useCallback as i}from"react";import{jsx as n}from"react/jsx-runtime";function a(e){const[t,n]=r(!1),a=o(void 0);c(()=>()=>clearTimeout(a.current),[]);return{copied:t,copy:i(t=>{t?.stopPropagation(),navigator.clipboard?.writeText(e).then(()=>{n(!0),clearTimeout(a.current),a.current=setTimeout(()=>n(!1),1500)},()=>{})},[e])}}function u({copied:t,className:r="w-4 h-4"}){/* @__PURE__ */
|
|
2
2
|
return n(e,t?{name:"check",className:`${r} text-green-600`,"aria-hidden":"true"}:{name:"copy",className:r,"aria-hidden":"true"})}function m({text:e}){const{copied:r,copy:o}=a(e),c=t().copy;/* @__PURE__ */
|
|
3
3
|
return n("button",{onClick:o,title:r?c.copiedValue:c.copyValue(e),className:"shrink-0 text-gray-400 hover:text-gray-600 transition-colors",children:/* @__PURE__ */n(u,{copied:r})})}export{m as CopyButton,u as CopyGlyph,a as useCopyText};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Markdown as e}from"./chunk-
|
|
1
|
+
import{Markdown as e}from"./chunk-4ELYV3L6.js";import{PLACEHOLDER_INK as t}from"./chunk-JFSYWEHD.js";import{Icon as r}from"./chunk-KIBL6M3T.js";import{LoadingSpinner as l}from"./chunk-Q5MD3VY6.js";import{useShellStrings as a}from"./chunk-VKMEQKYT.js";import{useState as s,useMemo as n}from"react";import{jsxs as o,jsx as i,Fragment as c}from"react/jsx-runtime";var d=({open:e})=>/* @__PURE__ */i(r,{name:"chevron-right",look:"mini",className:"h-3.5 w-3.5 shrink-0 transition-transform "+(e?"rotate-90":""),"aria-hidden":"true"});function h({docs:h,loading:m=!1,categoryOrder:p,canEdit:u=!1,onNew:g,onEdit:x,renderBody:y,emptyMessage:f}){const b=a(),[v,w]=s(""),[N,k]=s(null),[j,C]=s({}),L=v.trim().toLowerCase(),M=n(()=>{const e=/* @__PURE__ */new Map;for(const t of h){let r=e.get(t.category);r||(r={key:t.category,label:t.category_label||t.category,docs:[]},e.set(t.category,r)),r.docs.push(t)}if(!p?.length)return[...e.values()];const t=new Map(p.map((e,t)=>[e,t]));return[...e.values()].sort((e,r)=>(t.get(e.key)??1/0)-(t.get(r.key)??1/0))},[h,p]),E=e=>!L||e.title.toLowerCase().includes(L)||e.body.toLowerCase().includes(L)||e.category_label.toLowerCase().includes(L),_=n(()=>M.map(e=>({...e,docs:e.docs.filter(E)})).filter(e=>e.docs.length>0),[M,L]),Y=n(()=>_.flatMap(e=>e.docs),[_]),B=(N?Y.find(e=>e.slug===N):void 0)??Y[0]??null,K=e=>!!L||(j[e]??e===B?.category);/* @__PURE__ */
|
|
2
2
|
return o("div",{className:"flex h-full gap-4 px-4 py-3 min-h-0",children:[
|
|
3
3
|
/* @__PURE__ */o("aside",{className:"w-64 shrink-0 flex flex-col bg-white rounded-lg shadow overflow-hidden",children:[
|
|
4
4
|
/* @__PURE__ */o("div",{className:"flex items-center justify-between gap-2 px-3 py-2 border-b border-gray-200 bg-gray-50 shrink-0",children:[
|
|
@@ -6,9 +6,9 @@ return o("div",{className:"flex h-full gap-4 px-4 py-3 min-h-0",children:[
|
|
|
6
6
|
/* @__PURE__ */i("div",{className:"px-3 py-2 border-b border-gray-100 shrink-0",children:/* @__PURE__ */o("div",{className:"relative",children:[
|
|
7
7
|
/* @__PURE__ */i(r,{name:"search",look:"mini",className:`pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 h-4 w-4 ${t}`,"aria-hidden":"true"}),
|
|
8
8
|
/* @__PURE__ */i("input",{type:"text",value:v,onChange:e=>w(e.target.value),placeholder:b.help.searchPlaceholder,className:"w-full rounded-md border border-gray-300 bg-white h-8 pl-8 pr-2 text-sm shadow-sm focus:border-blue-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-accent)]"})]})}),
|
|
9
|
-
/* @__PURE__ */i("div",{className:"flex-1 overflow-y-auto py-1",children:m?/* @__PURE__ */i(l,{size:"sm",padding:"py-6",label:b.help.loading}):0===
|
|
9
|
+
/* @__PURE__ */i("div",{className:"flex-1 overflow-y-auto py-1",children:m?/* @__PURE__ */i(l,{size:"sm",padding:"py-6",label:b.help.loading}):0===_.length?/* @__PURE__ */i("p",{className:"px-3 py-6 text-center text-xs text-gray-500",children:L?b.help.noResults:f??b.help.empty}):_.map(e=>{const t=K(e.key);/* @__PURE__ */
|
|
10
10
|
return o("div",{className:"py-0.5",children:[
|
|
11
|
-
/* @__PURE__ */o("button",{type:"button",onClick:()=>{return t=e.key,C(e=>({...e,[t]:!
|
|
11
|
+
/* @__PURE__ */o("button",{type:"button",onClick:()=>{return t=e.key,C(e=>({...e,[t]:!K(t)}));var t},className:"w-full flex items-center gap-2 h-8 px-3 text-left text-3xs font-semibold uppercase tracking-wide text-gray-400 hover:text-gray-600",children:[
|
|
12
12
|
/* @__PURE__ */i(d,{open:t}),
|
|
13
13
|
/* @__PURE__ */i("span",{className:"truncate",children:e.label})]}),t&&e.docs.map(e=>{const t=B?.slug===e.slug;/* @__PURE__ */
|
|
14
14
|
return o("button",{type:"button",onClick:()=>k(e.slug),className:"w-full text-left pl-8 pr-3 min-h-(--row-height-menu) py-2 text-sm flex items-center gap-2 transition-colors "+(t?"bg-blue-50 text-blue-700 font-medium":"text-gray-700 hover:bg-gray-50"),children:[
|