efficient-shell 12.27.0 → 12.30.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 +38 -0
- package/dist/{Browser-6YRO47YI.js → Browser-FQHXHI3R.js} +18 -18
- package/dist/Calculator-XCRU5K4O.js +29 -0
- package/dist/{CurrencyConverter-G5IYUCN7.js → CurrencyConverter-EHIQIFJK.js} +9 -9
- package/dist/{Files-K7H7WHRS.js → Files-LTUUGPAM.js} +85 -85
- package/dist/{Notepad-EHISTRGJ.js → Notepad-JPAXNEFR.js} +9 -9
- package/dist/PdfViewer-J55QKFNS.js +1 -0
- package/dist/{PomodoroTimer-SFTPXEDV.js → PomodoroTimer-IVDZBBUN.js} +10 -10
- package/dist/{Preview-L4RT7TBC.js → Preview-KRK4XT2B.js} +35 -35
- package/dist/Sidebar-FCXIPW5K.js +44 -0
- package/dist/{Stock-YCPMLYPR.js → Stock-OBS2LPX4.js} +7 -7
- package/dist/{Weather-TLFNIPDG.js → Weather-I4TJBIEN.js} +17 -17
- package/dist/{WorldClock-66IRFS2W.js → WorldClock-YU2ZPVSA.js} +6 -6
- package/dist/ai/index.d.ts +155 -6
- package/dist/ai/index.js +109 -91
- package/dist/ai.css +1 -1
- package/dist/apps/ImageAnnotator.js +1 -1
- package/dist/apps/index.js +1 -1
- package/dist/bin/media-host-check.js +1 -1
- package/dist/bin/ui-check.js +1 -1
- package/dist/brand.css +1 -1
- package/dist/charts/BoxPlotChart.js +1 -1
- package/dist/charts/CandlestickChart.js +1 -1
- package/dist/charts/CartesianPlot.js +1 -1
- package/dist/charts/ChartBrush.js +1 -1
- package/dist/charts/ChartFrame.js +1 -1
- package/dist/charts/ChartSkeleton.js +1 -1
- package/dist/charts/ChordChart.js +1 -1
- package/dist/charts/ColumnChart.js +1 -1
- package/dist/charts/FlowChart.js +1 -1
- package/dist/charts/FunnelChart.js +1 -1
- package/dist/charts/HeatmapChart.js +1 -1
- package/dist/charts/HistogramChart.js +1 -1
- package/dist/charts/Meter.js +1 -1
- package/dist/charts/PieChart.js +1 -1
- package/dist/charts/RadarChart.js +1 -1
- package/dist/charts/RadialBarChart.js +1 -1
- package/dist/charts/RangeChart.js +1 -1
- package/dist/charts/RankedBars.js +1 -1
- package/dist/charts/SankeyChart.js +1 -1
- package/dist/charts/ScatterChart.js +1 -1
- package/dist/charts/SpecChart.js +1 -1
- package/dist/charts/StatTile.js +1 -1
- package/dist/charts/SunburstChart.js +1 -1
- package/dist/charts/TimeSeriesChart.js +1 -1
- package/dist/charts/TreemapChart.js +1 -1
- package/dist/charts/WaterfallChart.js +1 -1
- package/dist/{chunk-W2663E4S.js → chunk-23CZSU3H.js} +3 -3
- package/dist/{chunk-DK5SXOXJ.js → chunk-2DCATU5B.js} +1 -1
- package/dist/{chunk-RF3ZFTAU.js → chunk-2IEKMFVL.js} +1 -1
- package/dist/{chunk-676TKVDM.js → chunk-2N6WWL7Y.js} +1 -1
- package/dist/{chunk-KBI3T6UC.js → chunk-36MM4YRK.js} +9 -9
- package/dist/{chunk-3J3FBYIZ.js → chunk-37EYKPR6.js} +1 -1
- package/dist/{chunk-63TCQAGE.js → chunk-3B3QIHF7.js} +5 -5
- package/dist/chunk-3DSGJIC7.js +7 -0
- package/dist/{chunk-CCK2UWQ5.js → chunk-3HLV6BEC.js} +12 -12
- package/dist/{chunk-X34ZBXIU.js → chunk-3N4XJS43.js} +3 -3
- package/dist/{chunk-232YPI2L.js → chunk-3R2TMLKH.js} +5 -5
- package/dist/{chunk-YW3UKSON.js → chunk-3ZC53F4T.js} +3 -3
- package/dist/{chunk-OLCRYT3N.js → chunk-42GNFUAP.js} +12 -12
- package/dist/{chunk-7LTU5TJD.js → chunk-4EFIUJ7X.js} +1 -1
- package/dist/{chunk-VQ4X3OBR.js → chunk-4FUQK2LK.js} +1 -1
- package/dist/{chunk-QPSJYSET.js → chunk-4MCI7UHQ.js} +5 -5
- package/dist/chunk-4SEPQN2N.js +12 -0
- package/dist/{chunk-GEVNBBM7.js → chunk-4WW3SNL6.js} +1 -1
- package/dist/{chunk-TUPPFC74.js → chunk-4YCWO2GZ.js} +7 -7
- package/dist/{chunk-SSNTJ3M4.js → chunk-5O5QMMMG.js} +8 -8
- package/dist/{chunk-N32LNPPP.js → chunk-5RLJAXDR.js} +7 -7
- package/dist/{chunk-3YBXA72C.js → chunk-5X3Z45SL.js} +1 -1
- package/dist/{chunk-FD6DJRD4.js → chunk-5XYRFK7D.js} +1 -1
- package/dist/{chunk-3JL4TCA7.js → chunk-5ZS3VOJH.js} +1 -1
- package/dist/chunk-64ZDYUE7.js +27 -0
- package/dist/{chunk-XHZVUO6F.js → chunk-67JLD6AU.js} +5 -5
- package/dist/{chunk-OM6VWUAZ.js → chunk-6EETON2U.js} +1 -1
- package/dist/{chunk-4PIQG2ZK.js → chunk-6EXWWPAW.js} +1 -1
- package/dist/{chunk-N3R6N7LG.js → chunk-6UB6YY3H.js} +1 -1
- package/dist/{chunk-ZGWXSHVM.js → chunk-77BK2IAJ.js} +1 -1
- package/dist/chunk-7DTWIWFO.js +6 -0
- package/dist/chunk-7IGWU6DK.js +8 -0
- package/dist/{chunk-DCCYUCBM.js → chunk-7NO4IENQ.js} +1 -1
- package/dist/{chunk-YI6SYUAK.js → chunk-AIGLJYQ5.js} +1 -1
- package/dist/chunk-AJVL6LXI.js +22 -0
- package/dist/{chunk-34TQBJ7I.js → chunk-ANGNTN36.js} +1 -1
- package/dist/chunk-ASDYAASN.js +3 -0
- package/dist/{chunk-KZRZYLN7.js → chunk-AYCWVVJ3.js} +35 -35
- package/dist/{chunk-VLMBXPRM.js → chunk-B27XRZ47.js} +1 -1
- package/dist/{chunk-JN5NUZ6D.js → chunk-BEB3AGSY.js} +1 -1
- package/dist/{chunk-4ZRGMK7Y.js → chunk-CBBU74QT.js} +1 -1
- package/dist/chunk-CHV7U5UV.js +9 -0
- package/dist/{chunk-5WK56FA3.js → chunk-CIOPLPZW.js} +1 -1
- package/dist/{chunk-B4GRHE44.js → chunk-CVEVPB3O.js} +3 -3
- package/dist/chunk-CXXMSYA6.js +1 -0
- package/dist/{chunk-RY7JCGLI.js → chunk-DHRCI7KE.js} +1 -1
- package/dist/{chunk-Y523KUQC.js → chunk-DOKA65JI.js} +1 -1
- package/dist/{chunk-XKNKRKHH.js → chunk-E7RMS776.js} +14 -14
- package/dist/chunk-EWSOX4WP.js +28 -0
- package/dist/{chunk-BZHP645G.js → chunk-FEWWCWKV.js} +9 -9
- package/dist/{chunk-SR4W2SYQ.js → chunk-FIXZT5TZ.js} +7 -7
- package/dist/{chunk-6GWYFUME.js → chunk-FM34DWV7.js} +6 -6
- package/dist/{chunk-VP2GI3UP.js → chunk-FPYOZOUY.js} +8 -8
- package/dist/{chunk-QZCLHKCI.js → chunk-FSORYU5C.js} +12 -12
- package/dist/{chunk-FQ4IRBMA.js → chunk-FYGPJPU7.js} +1 -1
- package/dist/{chunk-KP2JYXEU.js → chunk-GANZLRMW.js} +9 -9
- package/dist/{chunk-WBGJ4XB7.js → chunk-GBPGZFBS.js} +4 -4
- package/dist/chunk-GKX3C3JE.js +13 -0
- package/dist/{chunk-QMSINDXL.js → chunk-GL4NELAT.js} +1 -1
- package/dist/{chunk-DGHSCKOE.js → chunk-GN3AHAVY.js} +4 -4
- package/dist/{chunk-THLXDI76.js → chunk-GOAFMGUI.js} +10 -10
- package/dist/{chunk-7ZJRBFHA.js → chunk-HC3BZPWX.js} +1 -1
- package/dist/{chunk-JSHMIMAJ.js → chunk-HCDG7EUR.js} +1 -1
- package/dist/{chunk-GUHCKMC7.js → chunk-HE2I6KWY.js} +2 -2
- package/dist/chunk-HJECGV6W.js +5 -0
- package/dist/{chunk-TYQ2JL4J.js → chunk-HOXXEF52.js} +1 -1
- package/dist/{chunk-3CKYFCX4.js → chunk-HRNT4UDG.js} +17 -17
- package/dist/{chunk-WPG3ZHYT.js → chunk-HU24RSAE.js} +1 -1
- package/dist/{chunk-I7JU4IU3.js → chunk-I6V4DMNR.js} +2 -2
- package/dist/{chunk-EEB5XPWP.js → chunk-IBPULOGJ.js} +2 -2
- package/dist/{chunk-RZ2DWX4N.js → chunk-ILSE5F5F.js} +5 -5
- package/dist/{chunk-KAKJ7ENS.js → chunk-IOIY54KO.js} +2 -2
- package/dist/{chunk-NUPK6CUV.js → chunk-IQTURGC4.js} +1 -1
- package/dist/{chunk-XZXFUZIK.js → chunk-ISVODSRP.js} +6 -3
- package/dist/{chunk-VBLCYL4L.js → chunk-JA5WM66L.js} +1 -1
- package/dist/{chunk-H6WXTJOT.js → chunk-JGZEZHMP.js} +1 -1
- package/dist/{chunk-CBVKGAZH.js → chunk-JOANOIVK.js} +1 -1
- package/dist/{chunk-24Y5JHIR.js → chunk-JTRQ7HAS.js} +1 -1
- package/dist/{chunk-GLRRX4AL.js → chunk-K5YT5PMJ.js} +1 -1
- package/dist/{chunk-CEIIQRK5.js → chunk-K6LO6QI5.js} +6 -6
- package/dist/chunk-KHFPF534.js +8 -0
- package/dist/{chunk-JGRDG7CB.js → chunk-KKYNDLOC.js} +6 -6
- package/dist/{chunk-4IHYWLWE.js → chunk-KLG6RYYC.js} +5 -5
- package/dist/{chunk-7K3FYCRZ.js → chunk-KNNFNOX7.js} +9 -9
- package/dist/chunk-KPFP2I2S.js +8 -0
- package/dist/{chunk-JZBLOIL7.js → chunk-KPPKPGQI.js} +1 -1
- package/dist/{chunk-SY66VJAI.js → chunk-KTO427N3.js} +1 -1
- package/dist/{chunk-XHSMDUEW.js → chunk-LBLWN3SH.js} +3 -3
- package/dist/chunk-LHATGPIE.js +19 -0
- package/dist/{chunk-T2TZBTSM.js → chunk-LQD54ZL5.js} +1 -1
- package/dist/{chunk-4ZLFAXOC.js → chunk-M2GF44WC.js} +12 -12
- package/dist/{chunk-AQCUGTOR.js → chunk-MFZ4YMXE.js} +6 -6
- package/dist/{chunk-VFHKD7TQ.js → chunk-MHVWUYEN.js} +1 -1
- package/dist/chunk-MKPZIEQP.js +23 -0
- package/dist/{chunk-KZHVKSNF.js → chunk-MRVW6F5E.js} +1 -1
- package/dist/chunk-MUSNAMWH.js +1 -0
- package/dist/{chunk-VEQ45GAH.js → chunk-MVBDE4AX.js} +1 -1
- package/dist/{chunk-3E3LR2PM.js → chunk-MYJ3HQYG.js} +12 -12
- package/dist/{chunk-JFGJJNT2.js → chunk-N2BWOHNM.js} +6 -6
- package/dist/{chunk-ILDPJ26Y.js → chunk-N2FX4O3H.js} +1 -1
- package/dist/{chunk-N2445WHJ.js → chunk-NJ6WZHXC.js} +5 -5
- package/dist/{chunk-YRY64DQV.js → chunk-NLQLVXMJ.js} +1 -1
- package/dist/{chunk-Z3CTYK3U.js → chunk-NSNM4QIV.js} +5 -5
- package/dist/{chunk-PLPMCE44.js → chunk-O3SCB4QZ.js} +8 -8
- package/dist/{chunk-UR2ECNBB.js → chunk-OMSIXLK4.js} +1 -1
- package/dist/{chunk-74JMBOQH.js → chunk-P4NWDRHS.js} +26 -26
- package/dist/{chunk-DMEP2SCP.js → chunk-PAVOVX3D.js} +3 -3
- package/dist/{chunk-LIWBCIRZ.js → chunk-PBZ3UQMS.js} +4 -4
- package/dist/chunk-PRWA4AAC.js +11 -0
- package/dist/{chunk-6RK6R3RY.js → chunk-PT4GMPUB.js} +1 -1
- package/dist/{chunk-MWTCGJAI.js → chunk-Q4BJW37U.js} +1 -1
- package/dist/{chunk-WNOXHJVT.js → chunk-QB7TIWHT.js} +5 -5
- package/dist/{chunk-YO26RV3H.js → chunk-QF4FYOVE.js} +1 -1
- package/dist/{chunk-DJXXY23A.js → chunk-QHWD3G7T.js} +2 -2
- package/dist/{chunk-GEZM6ARD.js → chunk-QIPO4EVJ.js} +1 -1
- package/dist/{chunk-6FZ5JTBY.js → chunk-QMBMK6PP.js} +2 -2
- package/dist/{chunk-TOVEZAIM.js → chunk-QOYKBINM.js} +1 -1
- package/dist/{chunk-WXZZGHET.js → chunk-QT34GMZR.js} +1 -1
- package/dist/chunk-QV5A7NFQ.js +11 -0
- package/dist/chunk-RJG67VRP.js +15 -0
- package/dist/{chunk-LBKKKZ4M.js → chunk-RMUOUMV2.js} +2 -2
- package/dist/{chunk-CALBDO7B.js → chunk-RPXRMTOU.js} +1 -1
- package/dist/chunk-RVD6HJUJ.js +4 -0
- package/dist/{chunk-CJHYOHMU.js → chunk-SAAXAAAH.js} +1 -1
- package/dist/chunk-TIYRBJSB.js +7 -0
- package/dist/{chunk-4BKJ6A5H.js → chunk-TJ5ZX5HP.js} +10 -10
- package/dist/chunk-TN3W72FC.js +8 -0
- package/dist/{chunk-2DYVVHZA.js → chunk-U22563X2.js} +1 -1
- package/dist/{chunk-QADNVFV5.js → chunk-U45APXV3.js} +1 -1
- package/dist/{chunk-OOWPLQD5.js → chunk-UEADX2GV.js} +2 -2
- package/dist/chunk-UK2D2CSB.js +14 -0
- package/dist/{chunk-Z66QBDNU.js → chunk-UOHHIEH4.js} +1 -1
- package/dist/{chunk-MEN4B6NP.js → chunk-UQNKFMJR.js} +12 -12
- package/dist/{chunk-FTMCNC66.js → chunk-UZFFSZFI.js} +1 -1
- package/dist/{chunk-SE6IQZYW.js → chunk-V64XY7L4.js} +9 -9
- package/dist/{chunk-75H4BWNC.js → chunk-VEF3STCH.js} +1 -1
- package/dist/chunk-VLI2ED22.js +7 -0
- package/dist/{chunk-V4XR4MOS.js → chunk-VREZFFRE.js} +1 -1
- package/dist/chunk-VY5NO4TS.js +2 -0
- package/dist/{chunk-QG37GJP2.js → chunk-WBAWJIVM.js} +4 -4
- package/dist/{chunk-CMJD5URC.js → chunk-WCJR2GNH.js} +18 -18
- package/dist/{chunk-Y7KDCC6E.js → chunk-WM37FXRK.js} +1 -1
- package/dist/{chunk-4LOHQ4QB.js → chunk-X27K2NCU.js} +5 -5
- package/dist/{chunk-L543DFHF.js → chunk-X5RFTIHV.js} +1 -1
- package/dist/chunk-XJTZU7UH.js +4 -0
- package/dist/{chunk-RBS3AWE7.js → chunk-XK3VYRLR.js} +1 -1
- package/dist/{chunk-FJVZ2W55.js → chunk-XMAOLCQV.js} +1 -1
- package/dist/{chunk-GC4N4UQM.js → chunk-XXRUDMD5.js} +5 -5
- package/dist/{chunk-34EBBZFK.js → chunk-Y6H5C6A4.js} +1 -1
- package/dist/{chunk-LPPJNZQ6.js → chunk-YGKQMENL.js} +1 -1
- package/dist/{chunk-NOGSS432.js → chunk-YNE5YC6E.js} +1 -1
- package/dist/chunk-YS3CF7GL.js +2 -0
- package/dist/{chunk-R62JKPYY.js → chunk-Z2Z653OO.js} +1 -1
- package/dist/{chunk-G2Y5I5OR.js → chunk-ZSVBEJ4G.js} +1 -1
- package/dist/data/DataTable.js +1 -1
- package/dist/data/EntityList.js +1 -1
- package/dist/data/Kanban.js +1 -1
- package/dist/data/ListFooter.js +1 -1
- package/dist/data/ListLoadError.js +1 -1
- package/dist/data/Pagination.js +1 -1
- package/dist/data/ResizableTable.js +1 -1
- package/dist/file-intake/index.js +1 -1
- package/dist/forms/BorderInput.js +1 -1
- package/dist/forms/BrandAssetEditor.js +1 -1
- package/dist/forms/Calendar.js +1 -1
- package/dist/forms/ColorPicker.js +1 -1
- package/dist/forms/ComposerAttachments.js +1 -1
- package/dist/forms/CornersInput.js +1 -1
- package/dist/forms/DatePicker.js +1 -1
- package/dist/forms/DateRangePicker.js +1 -1
- package/dist/forms/DateTimePicker.js +1 -1
- package/dist/forms/DisplayChips.js +1 -1
- package/dist/forms/FilePicker.js +1 -1
- package/dist/forms/FormErrorSummary.js +1 -1
- package/dist/forms/IconPicker.js +1 -1
- package/dist/forms/ImageFocusPoint.js +1 -1
- package/dist/forms/Input.js +1 -1
- package/dist/forms/InputNumber.js +1 -1
- package/dist/forms/LinkPicker.js +1 -1
- package/dist/forms/MediaLibrary.js +1 -1
- package/dist/forms/MediaUploadField.js +1 -1
- package/dist/forms/MediaUploadGrid.js +1 -1
- package/dist/forms/MediaUsedInList.js +1 -1
- package/dist/forms/NumericKeypad.js +1 -1
- package/dist/forms/PositionInput.js +1 -1
- package/dist/forms/RenameField.js +1 -1
- package/dist/forms/Select.js +1 -1
- package/dist/forms/SidesInput.d.ts +13 -2
- package/dist/forms/SidesInput.js +1 -1
- package/dist/forms/Slider.js +1 -1
- package/dist/forms/Snippet.js +1 -1
- package/dist/forms/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/UnitMenu.js +1 -1
- package/dist/forms/WidthsBar.js +1 -1
- package/dist/forms/mediaLibraryMenu.js +1 -1
- package/dist/forms/mediaMoveItems.js +1 -1
- package/dist/forms/textAlign.js +1 -1
- package/dist/forms/useFileIntake.js +1 -1
- package/dist/hooks/useTheme.d.ts +1 -1
- package/dist/icons/efficient-glyphs.js +1 -1
- package/dist/icons/efficient-looks.js +1 -1
- package/dist/icons/efficient.js +1 -1
- package/dist/icons/index.js +1 -1
- package/dist/icons/looks/map.js +1 -1
- package/dist/icons/payment.js +1 -1
- package/dist/icons/sets.js +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +506 -506
- package/dist/locales/zh-Hans.js +1 -1
- package/dist/map/index.js +5 -5
- package/dist/markdown/index.js +1 -1
- package/dist/model-viewer/index.d.ts +123 -0
- package/dist/model-viewer/index.js +7 -0
- package/dist/page-tabs/index.js +5 -5
- package/dist/pdf/index.js +1 -1
- package/dist/shell/Accordion.js +1 -1
- package/dist/shell/AppUpdateBanner.js +1 -1
- package/dist/shell/Avatar.js +1 -1
- package/dist/shell/Banner.js +1 -1
- package/dist/shell/Breadcrumbs.js +1 -1
- package/dist/shell/BudgetBar.js +1 -1
- package/dist/shell/Card.js +1 -1
- package/dist/shell/ColoredBadge.js +1 -1
- package/dist/shell/ConfirmDialog.js +1 -1
- package/dist/shell/ContainerFillChart.js +1 -1
- package/dist/shell/ContextMenu.js +1 -1
- package/dist/shell/CountBadge.js +1 -1
- package/dist/shell/Dialog.js +1 -1
- package/dist/shell/Drawer.js +1 -1
- package/dist/shell/DropdownMenu.js +1 -1
- package/dist/shell/EditableGrid.js +1 -1
- package/dist/shell/EmptyState.js +1 -1
- package/dist/shell/GlobalSearch.js +1 -1
- package/dist/shell/HelpCenter.js +1 -1
- package/dist/shell/IconRail.js +1 -1
- package/dist/shell/ImageLightbox.js +1 -1
- package/dist/shell/ItemCount.js +1 -1
- package/dist/shell/LanguageSelect.js +1 -1
- package/dist/shell/Markdown.js +1 -1
- package/dist/shell/MetricBar.js +1 -1
- package/dist/shell/MetricBarLegend.js +1 -1
- package/dist/shell/MilestoneTimeline.js +1 -1
- package/dist/shell/PageHeader.js +1 -1
- package/dist/shell/PopupMenu.js +1 -1
- package/dist/shell/ProductionTimeline.js +1 -1
- package/dist/shell/ResizeHandle.js +1 -1
- package/dist/shell/Result.js +1 -1
- package/dist/shell/SearchableSelect.js +1 -1
- package/dist/shell/SettingReset.js +1 -1
- package/dist/shell/SettingRow.js +1 -1
- package/dist/shell/SidebarLayout.js +1 -1
- package/dist/shell/SidebarNav.js +1 -1
- package/dist/shell/SortableList.js +1 -1
- package/dist/shell/Statistic.js +1 -1
- package/dist/shell/StepChain.js +1 -1
- package/dist/shell/Stepper.js +1 -1
- package/dist/shell/TimeAgo.js +1 -1
- package/dist/shell/TimelineTrack.js +1 -1
- package/dist/shell/TopNav.js +1 -1
- package/dist/shell/TransferProgress.js +1 -1
- package/dist/shell/Tree.js +1 -1
- package/dist/shell/discardGuard.js +1 -1
- package/dist/shell/language.js +1 -1
- package/dist/shell/strings.d.ts +10 -0
- package/dist/shell/strings.js +1 -1
- package/dist/shell/toast.js +1 -1
- package/dist/telemetry/index.js +1 -1
- package/dist/templates/AuthScreen.js +1 -1
- package/dist/templates/ChatTemplate.js +1 -1
- package/dist/templates/CheckoutTemplate.js +1 -1
- package/dist/templates/DashboardTemplate.js +1 -1
- package/dist/templates/DataTablePage.js +1 -1
- package/dist/templates/EmailTemplate.js +1 -1
- package/dist/templates/ErrorBoundary.d.ts +1 -1
- package/dist/templates/ErrorBoundary.js +1 -1
- package/dist/templates/ErrorPage.js +1 -1
- package/dist/templates/FormLayoutPage.js +1 -1
- package/dist/templates/GalleryTemplate.js +1 -1
- package/dist/ui/index.d.ts +1 -1
- package/dist/ui/index.js +1 -1
- package/dist/version.js +1 -1
- package/package.json +12 -1
- package/dist/Calculator-LSDVIJVQ.js +0 -29
- package/dist/PdfViewer-UY5SRC63.js +0 -1
- package/dist/Sidebar-BKNCPUOE.js +0 -44
- package/dist/chunk-436PJFHC.js +0 -11
- package/dist/chunk-4Y33Y4OX.js +0 -8
- package/dist/chunk-574SLTKO.js +0 -8
- package/dist/chunk-A4PFVMQ2.js +0 -7
- package/dist/chunk-BHHFVIAD.js +0 -2
- package/dist/chunk-BM2QIV64.js +0 -23
- package/dist/chunk-D2WJAF62.js +0 -4
- package/dist/chunk-DG2TGWXI.js +0 -15
- package/dist/chunk-DRMIQ3YE.js +0 -1
- package/dist/chunk-ENFXDIIZ.js +0 -8
- package/dist/chunk-FI6IJTAJ.js +0 -14
- package/dist/chunk-FVKXDF2Q.js +0 -12
- package/dist/chunk-HMT3MES3.js +0 -27
- package/dist/chunk-INADSWOF.js +0 -28
- package/dist/chunk-LCEQIFPK.js +0 -3
- package/dist/chunk-OM42AUMS.js +0 -4
- package/dist/chunk-OQ6TECLX.js +0 -6
- package/dist/chunk-SFULX4E3.js +0 -7
- package/dist/chunk-T7D73HT7.js +0 -11
- package/dist/chunk-TM4CRQ3W.js +0 -19
- package/dist/chunk-TU2L7NW3.js +0 -7
- package/dist/chunk-UP4HLGMZ.js +0 -9
- package/dist/chunk-VABHQDN5.js +0 -1
- package/dist/chunk-VDYF3WPJ.js +0 -2
- package/dist/chunk-XQWHKXLS.js +0 -22
- package/dist/chunk-YIUWX2IU.js +0 -8
- package/dist/chunk-YX2OOGV7.js +0 -4
- package/dist/chunk-ZQ24H5UO.js +0 -13
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{useOverlayTarget as e,usePopupAnchor as t,usePopupLevel as r,usePopupLevelBindings as i,windowScrimStyle as o,OverlayLayerProvider as n,scrimHasCorners as l,popupLayerStyle as s}from"./chunk-RIG5FEVS.js";import{useDiscardGuard as a}from"./chunk-CIOPLPZW.js";import{dialogA11y as d}from"./chunk-VWGWZY7A.js";import{useDismissPopupsOnOpen as c}from"./chunk-7QSDPSXP.js";import{useFocusTrap as m,useScrollLock as h}from"./chunk-DWGYC7OD.js";import{Icon as u}from"./chunk-ISVODSRP.js";import{useHydrated as p}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as f}from"./chunk-TWVUQUUD.js";import{useShellStrings as b}from"./chunk-HCDG7EUR.js";import{useRef as g,useId as x,useState as y,useEffect as v}from"react";import{createPortal as w}from"react-dom";import{jsxs as k,Fragment as N,jsx as j}from"react/jsx-runtime";var C={sm:"sm:w-[320px]",md:"sm:w-[448px]",lg:"sm:w-[640px]"},D={right:"inset-y-0 right-0",left:"inset-y-0 left-0",bottom:"inset-x-0 bottom-0"};function W(e,t){const r=window.innerHeight-(t.top+t.height);if("bottom"===e)return{left:t.left,width:t.width,bottom:r};const i={top:t.top,height:t.height};return"left"===e?{...i,left:t.left}:{...i,right:window.innerWidth-(t.left+t.width)}}function P({onClose:e}){const t=b().dialog;/* @__PURE__ */
|
|
2
|
+
return j("button",{type:"button",onClick:e,"aria-label":t.close,className:"rounded-(--radius-control) p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:/* @__PURE__ */j(u,{name:"close",className:"h-5 w-5",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true"})})}function S({open:u,onClose:b,side:S="right",size:G="md",title:H,description:I,footer:U,children:V,blocking:E=!1,dirty:O=!1,initialFocus:R,"aria-label":z,"aria-labelledby":B,"aria-describedby":F,className:L=""}){const Q=g(null),T=x(),Y=x(),Z=x(),A=e(p()),[J,X]=y(null),$=a({open:u,dirty:O,onClose:b,title:H,layer:J}),q=g(null),K=t(u&&null!==A,q),M=r(u&&null!==A,q),_=i(M,J),ee=o(M),te=null!==M.host;if(c(u),m(Q,u&&null!==A,R,_),h(u),v(()=>{if(u)return f(()=>!_.current?.(document.activeElement)&&(E||$(),!0),()=>Q.current)},[u,E,$,_]),!u||!A)return null;const re="bottom"===S,ie={...re?{maxHeight:"85vh"}:{},...K?W(S,K):{}};/* @__PURE__ */
|
|
3
|
+
return k(N,{children:[/* @__PURE__ */j("span",{ref:q,hidden:!0,"data-popup-anchor":""}),w(
|
|
4
|
+
/* @__PURE__ */j(n,{value:J,children:/* @__PURE__ */k("div",{ref:X,className:te?"fixed inset-0 pointer-events-none":"fixed inset-0",style:s(M),role:"presentation","data-overlay-layer":"",children:[
|
|
5
|
+
/* @__PURE__ */j("div",{className:"fixed bg-black/30 backdrop-blur-sm "+(te?"pointer-events-auto"+(l(M)?" rounded-(--radius-window)":""):"inset-0"),style:ee??void 0,hidden:te&&!ee,onClick:E?void 0:$,"aria-hidden":"true","data-popup-scrim":te?"window":"system"}),
|
|
6
|
+
/* @__PURE__ */k("div",{ref:Q,...d({modal:!0,titleId:H?Z:void 0,labelledBy:B,label:z}),"aria-describedby":F??(I?Y:V?T:void 0),"data-drawer-side":S,"data-popup-panel":"",style:ie,className:["fixed flex flex-col bg-white shadow-xl",te?"pointer-events-auto":"",re?"":`w-full max-w-full ${C[G]}`,K?"":D[S],re?"rounded-t-xl":"",L].filter(Boolean).join(" "),children:[H?/* @__PURE__ */k("div",{className:"flex shrink-0 items-center justify-between gap-4 border-b border-gray-100 px-4 py-3",children:[
|
|
7
|
+
/* @__PURE__ */k("div",{className:"min-w-0",children:[
|
|
8
|
+
/* @__PURE__ */j("h2",{id:Z,className:"text-base font-semibold text-gray-900",children:H}),I&&/* @__PURE__ */j("p",{id:Y,className:"mt-0.5 text-sm text-gray-500",children:I})]}),!E&&/* @__PURE__ */j(P,{onClose:$})]}):!E&&/* @__PURE__ */j("div",{className:"absolute right-2 top-2 z-10",children:/* @__PURE__ */j(P,{onClose:$})}),
|
|
9
|
+
/* @__PURE__ */k("div",{id:T,className:"min-h-0 flex-1 overflow-y-auto px-4 py-4",children:[I&&!H&&/* @__PURE__ */j("p",{id:Y,className:("mb-3 text-sm text-gray-500 "+(E?"":"pr-8")).trim(),children:I}),V]}),U&&/* @__PURE__ */j("div",{className:"flex shrink-0 justify-end gap-3 border-t border-gray-100 px-4 py-3",children:U})]})]})}),A)]})}export{S as Drawer};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useShellStrings as t}from"./chunk-
|
|
1
|
+
import{useShellStrings as t}from"./chunk-HCDG7EUR.js";import{useRef as e,useEffect as r,useCallback as n}from"react";function i({open:i,dirty:o,onClose:c,title:s,layer:u}){const a=t().dialog,d=e(!1),l=e(!1),m=e({dirty:o,onClose:c,title:s,strings:a});return r(()=>{m.current={dirty:o,onClose:c,title:s,strings:a}}),r(()=>{i||(d.current=!1)},[i]),r(()=>{if(!i||"auto"!==o||!u)return;const t=t=>{u.contains(t.target)&&(d.current=!0)};return document.addEventListener("input",t,!0),document.addEventListener("change",t,!0),()=>{document.removeEventListener("input",t,!0),document.removeEventListener("change",t,!0)}},[i,o,u]),n(()=>{const{dirty:t,onClose:e,title:r,strings:n}=m.current;if(l.current)return;("auto"===t?d.current:t)?(l.current=!0,import("./shell/ConfirmDialog.js").then(({confirm:t})=>t({title:n.discardTitle,message:n.discardMessage("string"==typeof r?r:void 0),confirmLabel:n.discardConfirm,cancelLabel:n.keepEditing,variant:"warning"})).then(t=>{l.current=!1,t&&(d.current=!1,m.current.onClose())})):e()},[])}export{i as useDiscardGuard};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{useSidebarSheet as e}from"./chunk-QWK6DRSN.js";import{resolveSeverity as t,severityWord as n}from"./chunk-TZFNWAED.js";import{ItemCount as r}from"./chunk-
|
|
1
|
+
import{useSidebarSheet as e}from"./chunk-QWK6DRSN.js";import{resolveSeverity as t,severityWord as n}from"./chunk-TZFNWAED.js";import{ItemCount as r}from"./chunk-Q4BJW37U.js";import{Icon as l}from"./chunk-ISVODSRP.js";import{useBrowserState as a}from"./chunk-D65T4H6J.js";import{useShellStrings as i}from"./chunk-HCDG7EUR.js";import{useId as o,useRef as c,useEffect as s,Children as u,isValidElement as d}from"react";import{jsx as m,jsxs as h,Fragment as p}from"react/jsx-runtime";function f({children:e,count:t,countLabel:n}){return null==t?/* @__PURE__ */m("p",{className:"px-3 pb-1 pt-1 text-xs font-semibold uppercase tracking-wide text-gray-500",children:e}):/* @__PURE__ */h("p",{className:"flex items-center justify-between gap-2 px-3 pb-1 pt-1 text-xs font-semibold uppercase tracking-wide text-gray-500",children:[
|
|
2
2
|
/* @__PURE__ */m("span",{className:"min-w-0 truncate",children:e}),
|
|
3
|
-
/* @__PURE__ */m(r,{count:t,label:n,showZero:!0})]})}function b(e){return"flex min-w-0 flex-1 items-center justify-between gap-2 rounded-r-lg border-l-2 h-8 px-3 text-sm "+(e?"border-blue-500 bg-accent-tint font-medium text-blue-700":"border-line text-ink hover:bg-gray-100")}function x({label:l,count:a,countLabel:u,active:d,onClick:f,icon:x,trailing:g,severity:w,depth:k=0}){const y=t(w,"SidebarNavItem"),v=i().severity,N=y?n(y,v):void 0,j=e(),
|
|
3
|
+
/* @__PURE__ */m(r,{count:t,label:n,showZero:!0})]})}function b(e){return"flex min-w-0 flex-1 items-center justify-between gap-2 rounded-r-lg border-l-2 h-8 px-3 text-sm "+(e?"border-blue-500 bg-accent-tint font-medium text-blue-700":"border-line text-ink hover:bg-gray-100")}function x({label:l,count:a,countLabel:u,active:d,onClick:f,icon:x,trailing:g,severity:w,depth:k=0}){const y=t(w,"SidebarNavItem"),v=i().severity,N=y?n(y,v):void 0,j=e(),S=o(),C=c(null),I=c(l);I.current=l,s(()=>{if(j&&d)return j.report(S,()=>I.current,C.current)},[j,d,S]);const D=/* @__PURE__ */h(p,{children:[null!=x&&/* @__PURE__ */m("span",{"aria-hidden":"true",className:"shrink-0 h-4 w-4",children:x}),y&&
|
|
4
4
|
/* @__PURE__ */m("span",{"aria-hidden":"true",title:N,className:`shrink-0 h-1.5 w-1.5 rounded-full ${y.fill}`}),
|
|
5
5
|
/* @__PURE__ */m("span",{className:"min-w-0 truncate mr-auto",title:"string"==typeof l?l:void 0,children:l}),y&&/* @__PURE__ */m("span",{className:"sr-only",children:N}),null!=a&&/* @__PURE__ */m(r,{count:a,label:u,active:d}),null!=g&&/* @__PURE__ */m("span",{className:"shrink-0",children:g})]});/* @__PURE__ */
|
|
6
|
-
return m("button",1===k?{ref:
|
|
6
|
+
return m("button",1===k?{ref:C,type:"button",onClick:f,className:"flex w-full pl-5 text-left",children:/* @__PURE__ */m("span",{className:b(d),children:D})}:{ref:C,type:"button",onClick:f,className:"flex w-full items-center justify-between gap-2 rounded-lg h-8 px-3 text-sm text-left "+(d?"bg-accent-tint font-medium text-blue-700":"text-ink hover:bg-gray-100"),children:D})}function g({label:e,count:t,countLabel:n,children:i,defaultExpanded:c=!0,storageKey:s}){const p=o(),[f,b]=a(()=>{if(s){let e=null;try{e=window.localStorage.getItem(s)}catch{}if("1"===e||"0"===e)return"1"===e}return c},c),x=!f&&u.toArray(i).some(e=>d(e)&&!0===e.props.active);/* @__PURE__ */
|
|
7
7
|
return h("div",{children:[
|
|
8
8
|
/* @__PURE__ */h("button",{type:"button",onClick:()=>{const e=!f;if(b(e),s)try{window.localStorage.setItem(s,e?"1":"0")}catch{}},"aria-expanded":f,"aria-controls":p,className:"flex w-full items-center gap-2 rounded-lg h-8 px-3 text-sm font-medium text-left "+(x?"bg-accent-tint text-blue-700":"text-ink-strong hover:bg-gray-100"),children:[
|
|
9
9
|
/* @__PURE__ */m("span",{className:"min-w-0 truncate",title:e,children:e}),
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var r="12.30.0",a=r;export{a as APP_VERSION,r as VERSION};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Breadcrumbs as e}from"./chunk-
|
|
1
|
+
import{Breadcrumbs as e}from"./chunk-GL4NELAT.js";import{jsxs as t,jsx as s}from"react/jsx-runtime";function i({title:i,description:r,subtitle:c,actions:a,children:n,icon:l,breadcrumbs:m}){const d=r??c,h=a??n;/* @__PURE__ */
|
|
2
2
|
return t("div",{className:"mb-6",children:[m&&m.length>0&&/* @__PURE__ */s(e,{items:m,className:"mb-3"}),
|
|
3
3
|
/* @__PURE__ */t("div",{className:"flex items-start justify-between gap-4",children:[
|
|
4
4
|
/* @__PURE__ */t("div",{children:[
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Icon as e}from"./chunk-
|
|
1
|
+
import{Icon as e}from"./chunk-ISVODSRP.js";import{DEFAULT_SHELL_STRINGS as t}from"./chunk-HCDG7EUR.js";import{jsx as r}from"react/jsx-runtime";var n=["left","center","right","justify"],a={left:"align-left",center:"align-center",right:"align-right",justify:"align-justify"};function i(t){switch(t){case"left":/* @__PURE__ */
|
|
2
2
|
return r(e,{name:"align-left"});case"center":/* @__PURE__ */
|
|
3
3
|
return r(e,{name:"align-center"});case"right":/* @__PURE__ */
|
|
4
4
|
return r(e,{name:"align-right"});case"justify":/* @__PURE__ */
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import{Pagination as e}from"./chunk-
|
|
1
|
+
import{Pagination as e}from"./chunk-HU24RSAE.js";import{Checkbox_default as t}from"./chunk-CGZBDI6C.js";import{SpinnerRing as r}from"./chunk-R2VKEMZH.js";import{TH_ONE_LINE as o,OneLineLabel as n}from"./chunk-G67CJAQ2.js";import{useBrowserLayoutEffect as l}from"./chunk-D65T4H6J.js";import{useShellStrings as s}from"./chunk-HCDG7EUR.js";import{useState as i,useRef as a}from"react";import{jsxs as c,Fragment as d,jsx as h}from"react/jsx-runtime";function u(e){const t={};if(!e)return t;for(const[r,o]of Object.entries(e))!r.startsWith("data-")||"string"!=typeof o&&"number"!=typeof o&&"boolean"!=typeof o||(t[r]=o);return t}var m=e=>Array.isArray(e.columns),f=e=>"wide"===e.only?"rosh-dt-only-wide":"stacked"===e.only?"rosh-dt-only-stacked":"",g="rosh-dt-row-link rosh-focus-ring underline-offset-4 hover:underline",p={sm:"px-2 py-2",md:"px-3 py-2"},y={left:"text-left",right:"text-right",center:"text-center"};function b({direction:e}){/* @__PURE__ */
|
|
2
2
|
return c("span",{className:"ml-1 inline-flex flex-col leading-none","aria-hidden":"true",children:[
|
|
3
3
|
/* @__PURE__ */h("svg",{className:"h-2 w-2 "+("asc"===e?"text-gray-700":"text-gray-300"),viewBox:"0 0 8 5",fill:"currentColor",children:/* @__PURE__ */h("path",{d:"M4 0L8 5H0z"})}),
|
|
4
|
-
/* @__PURE__ */h("svg",{className:"h-2 w-2 "+("desc"===e?"text-gray-700":"text-gray-300"),viewBox:"0 0 8 5",fill:"currentColor",children:/* @__PURE__ */h("path",{d:"M4 5L0 0h8z"})})]})}function w(e,t=!1){const r=t?"":" whitespace-nowrap";return e.code?`font-mono${r}`:e.numeric?`tabular-nums${r}`:""}function x({columns:x,data:v,rowKey:k,sort:N=null,onSortChange:C,pagination:j,caption:M,loading:B=!1,bordered:S=!1,size:$="md",minWidth:H,rowClassName:z,onRow:T,rowHref:
|
|
5
|
-
return h("th",{scope:"col",...
|
|
4
|
+
/* @__PURE__ */h("svg",{className:"h-2 w-2 "+("desc"===e?"text-gray-700":"text-gray-300"),viewBox:"0 0 8 5",fill:"currentColor",children:/* @__PURE__ */h("path",{d:"M4 5L0 0h8z"})})]})}function w(e,t=!1){const r=t?"":" whitespace-nowrap";return e.code?`font-mono${r}`:e.numeric?`tabular-nums${r}`:""}function x({columns:x,data:v,rowKey:k,sort:N=null,onSortChange:C,pagination:j,caption:M,loading:B=!1,bordered:S=!1,size:$="md",minWidth:H,rowClassName:z,onRow:T,rowHref:A,onRowPress:E,linkAs:I,emptyText:R,selection:D,footer:F,virtualized:L,stackOnNarrow:O=!1,stackBelow:P,className:G=""}){const K=s(),W=R??K.table.empty,J=(e,t)=>"function"==typeof k?k(e,t):String(e[k]),U=O&&!L,Z=U?x:x.flatMap(e=>{if(!m(e))return"stacked"===e.only?[]:[e];const t=e.columns.filter(e=>"stacked"!==e.only);return t.length?[{...e,columns:t}]:[]}),Q=e=>U?{role:e}:{},V=(e,t)=>(t??("string"==typeof e||"number"==typeof e?String(e):"")).trim()||void 0,[q,X]=i(0),Y=L?.overscan??6,_=L?e=>{const t=Math.max(0,Math.floor(e.currentTarget.scrollTop/L.rowHeight)-Y);X(e=>e===t?e:t)}:void 0,ee=L?Math.ceil(L.height/L.rowHeight)+2*Y:v.length,te=L?Math.min(q,Math.max(0,v.length-ee)):0,re=Math.min(v.length,te+ee),oe=L?te*L.rowHeight:0,ne=L?(v.length-re)*L.rowHeight:0,le=a(null),[se,ie]=i(0);l(()=>{if(!L)return;const e=le.current?.offsetHeight??0;ie(t=>t===e?t:e)});const ae=e=>e.sortField??e.key,ce=e=>N&&N.field===ae(e)?N.direction:null,de=Z.flatMap(e=>m(e)?e.columns:[e]),he=Z.some(m),ue=/* @__PURE__ */new Map;if(U)for(const e of Z)if(m(e))for(const t of e.columns)ue.set(t,V(e.title,e.label));const me=e=>{const t=V(e.title,e.label),r=ue.get(e);return t&&r?`${r} · ${t}`:t},fe=new Set(D?.selected??[]),ge=D?v.map((e,t)=>J(e,t)):[],pe=ge.length>0&&ge.every(e=>fe.has(e)),ye=ge.some(e=>fe.has(e)),be=D?36:0,we=de.length+(D?1:0),xe=de.some(e=>"left"===e.fixed),ve=U&&!D&&de.some(e=>e.cardCorner),ke=I??"a",Ne=`${p[$]} ${"sm"===$?"text-xs":"text-sm"}`,Ce=(e,t)=>e.ellipsis?/* @__PURE__ */h("span",{className:"block w-0 min-w-full",children:t}):t,je=(e,t,r,l=0)=>{const s=ce(e),i=y[e.align??(e.numeric?"right":"left")],a="left"===e.fixed,d=!(!e.sortable||!C);/* @__PURE__ */
|
|
5
|
+
return h("th",{scope:"col",...Q("columnheader"),rowSpan:r>1?r:void 0,"aria-sort":"asc"===s?"ascending":"desc"===s?"descending":d?"none":void 0,style:{width:e.width,...a?{left:(Be[t]??0)+be}:{},...L?{top:l}:{}},className:[Ne,i,o,"font-semibold uppercase tracking-wide text-gray-500","sm"===$?"text-2xs":"text-xs",a?L?"sticky z-20 bg-gray-50":"sticky z-10 bg-gray-50":L?"sticky z-10 bg-gray-50":"",U&&d?"rosh-dt-sort":"",U?f(e):"",e.headerClassName??""].filter(Boolean).join(" "),children:Ce(e,d?/* @__PURE__ */c("button",{type:"button",onClick:()=>(e=>{if(!C)return;const t=ae(e),r=ce(e),o=e.sortFirst??"asc";C(null===r?{field:t,direction:o}:r===o?{field:t,direction:"asc"===o?"desc":"asc"}:null)})(e),"data-group":U?ue.get(e):void 0,className:`inline-flex max-w-full items-center font-semibold uppercase tracking-wide hover:text-ink ${i}`,children:[
|
|
6
6
|
/* @__PURE__ */h(n,{children:e.title}),
|
|
7
7
|
/* @__PURE__ */h(b,{direction:s})]}):/* @__PURE__ */h(n,{children:e.title}))},e.key)};let Me=0;const Be=de.map(e=>{if("left"!==e.fixed)return null;const t=Me;return Me+=e.width??0,t}),Se=/* @__PURE__ */c(d,{children:[
|
|
8
|
-
/* @__PURE__ */c("div",{onScroll:_,style:
|
|
8
|
+
/* @__PURE__ */c("div",{onScroll:_,style:L?{maxHeight:L.height}:void 0,className:`relative overflow-x-auto ${L?"overflow-y-auto":""} ${S?"rounded-lg border border-gray-200":""}${U?" rosh-dt-scroll":""}`.trim(),children:[B&&
|
|
9
9
|
/* @__PURE__ */c("div",{className:"absolute inset-0 z-20 flex items-start justify-center bg-white/60 pt-8",role:"status","aria-live":"polite",children:[
|
|
10
10
|
/* @__PURE__ */h(r,{className:"h-6 w-6"}),
|
|
11
|
-
/* @__PURE__ */h("span",{className:"sr-only",children:
|
|
12
|
-
/* @__PURE__ */c("table",{...
|
|
13
|
-
/* @__PURE__ */c("thead",{...
|
|
14
|
-
/* @__PURE__ */c("tr",{ref:le,...
|
|
15
|
-
/* @__PURE__ */h("tbody",{...
|
|
16
|
-
return c("tr",{...u(n),...
|
|
17
|
-
return h("td",{...
|
|
18
|
-
return h("td",{...
|
|
19
|
-
/* @__PURE__ */h("span",{className:["rosh-dt-value",w(e,!0)].filter(Boolean).join(" "),children:o}):o},e.key)})]},
|
|
20
|
-
return h("div",
|
|
11
|
+
/* @__PURE__ */h("span",{className:"sr-only",children:K.table.loading})]}),
|
|
12
|
+
/* @__PURE__ */c("table",{...Q("table"),className:(U?"rosh-dt-table ":"")+"w-full border-collapse tabular-nums",style:H?{minWidth:H}:void 0,children:[M&&/* @__PURE__ */h("caption",{className:"sr-only",children:M}),
|
|
13
|
+
/* @__PURE__ */c("thead",{...Q("rowgroup"),className:U?"rosh-dt-head":void 0,children:[
|
|
14
|
+
/* @__PURE__ */c("tr",{ref:le,...Q("row"),className:"border-b border-gray-200 bg-gray-50",children:[D&&/* @__PURE__ */h("th",{scope:"col",...Q("columnheader"),rowSpan:he?2:void 0,style:{width:36,...L?{top:0}:{}},className:[Ne,o,xe||L?"sticky z-20 bg-gray-50":"",xe?"left-0":"",U?"rosh-dt-select":""].filter(Boolean).join(" "),children:/* @__PURE__ */h(t,{"aria-label":K.table.selectAll,checked:pe,indeterminate:ye&&!pe,onChange:()=>{if(!D)return;const e=new Set(ge);D.onChange(pe?D.selected.filter(t=>!e.has(t)):[...D.selected,...ge.filter(e=>!fe.has(e))])}})}),Z.map((e,t)=>m(e)?/* @__PURE__ */h("th",{scope:"colgroup",...Q("columnheader"),colSpan:e.columns.length,style:L?{top:0}:void 0,className:[Ne,"text-center",o,"font-semibold uppercase tracking-wide text-gray-500","sm"===$?"text-2xs":"text-xs","border-b border-gray-200",L?"sticky z-10 bg-gray-50":"",e.headerClassName??""].filter(Boolean).join(" "),children:/* @__PURE__ */h(n,{children:e.title})},e.key??`group-${t}`):je(e,de.indexOf(e),he?2:1))]}),he&&/* @__PURE__ */h("tr",{...Q("row"),className:"border-b border-gray-200 bg-gray-50",children:Z.flatMap(e=>m(e)?e.columns:[]).map(e=>je(e,de.indexOf(e),1,se))})]}),
|
|
15
|
+
/* @__PURE__ */h("tbody",{...Q("rowgroup"),className:U?"rosh-dt-body":void 0,children:0!==v.length||B?/* @__PURE__ */c(d,{children:[oe>0&&/* @__PURE__ */h("tr",{"aria-hidden":"true",children:/* @__PURE__ */h("td",{colSpan:we,style:{height:oe,padding:0,border:0}})}),v.slice(te,re).map((e,r)=>{const o=te+r,n=T?.(e,o),l=!!n?.current,s=A?.(e,o),i=void 0===s&&E?()=>E(e,o):void 0,a=void 0!==s||void 0!==i;let d=!1;const m=(e,t)=>{if(d=!0,!a)return e;const r=[g,i?"cursor-pointer text-left":"",t?.className??""].filter(Boolean).join(" "),o=l?"true":void 0;return void 0!==s?/* @__PURE__ */h(ke,{href:s,className:r,"aria-current":o,children:e}):/* @__PURE__ */h("button",{type:"button",onClick:i,className:r,"aria-current":o,children:e})},p=de.map(t=>t.render?t.render(e,o,m):t.dataIndex?e[t.dataIndex]:null);if(a&&!d){const e=de.findIndex(e=>"stacked"!==e.only&&!e.cardCorner),t=de.findIndex(e=>"wide"!==e.only&&!e.cardCorner);for(const r of/* @__PURE__ */new Set([e,t]))r>=0&&(p[r]=m(p[r]))}const b=e=>e?t=>{t.currentTarget.contains(t.relatedTarget)||e()}:void 0;/* @__PURE__ */
|
|
16
|
+
return c("tr",{...u(n),...Q("row"),style:L?{height:L.rowHeight}:void 0,onClick:n?.onClick,onMouseEnter:n?.onMouseEnter,onMouseLeave:n?.onMouseLeave,onFocus:b(n?.onFocus),onBlur:b(n?.onBlur),"aria-current":l&&!a?"true":void 0,...n?.onClick?{tabIndex:0,onKeyDown:e=>{e.target===e.currentTarget&&("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),n.onClick?.()))}}:{},className:[U?D?"rosh-dt-row rosh-dt-row-select":"rosh-dt-row":"",U&&ve?"rosh-dt-row-corner":"","border-b border-gray-100 last:border-b-0",n?.onClick?"cursor-pointer hover:bg-gray-50 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring-solid)]":"",a?"rosh-dt-linked hover:bg-gray-50":"",l?"rosh-dt-current":"",z?.(e,o)??"",n?.className??""].filter(Boolean).join(" "),children:[D&&(()=>{const r=J(e,o);/* @__PURE__ */
|
|
17
|
+
return h("td",{...Q("cell"),style:{width:36},onClick:e=>e.stopPropagation(),className:[Ne,xe?"sticky left-0 z-10 bg-white":"",U?"rosh-dt-select":""].filter(Boolean).join(" "),children:/* @__PURE__ */h(t,{"aria-label":K.table.selectRow,checked:fe.has(r),onChange:()=>(e=>{D&&D.onChange(fe.has(e)?D.selected.filter(t=>t!==e):[...D.selected,e])})(r)})})})(),de.map((e,t)=>{const r="left"===e.fixed,o=p[t],n=ve&&!!e.cardCorner,l=U&&!n&&"wide"!==e.only;/* @__PURE__ */
|
|
18
|
+
return h("td",{...Q("cell"),"data-label":l?me(e):void 0,style:r?{left:(Be[t]??0)+be}:void 0,className:[l?e.ellipsis?"rosh-dt-cell rosh-dt-clip":"rosh-dt-cell":"",n?"rosh-dt-corner":"",U?f(e):"",Ne,y[e.align??(e.numeric?"right":"left")],U?"":w(e),"text-ink-strongest",e.ellipsis?"max-w-0 truncate":"",r?"sticky z-10 bg-white":"",e.className??""].filter(Boolean).join(" "),children:U?
|
|
19
|
+
/* @__PURE__ */h("span",{className:["rosh-dt-value",w(e,!0)].filter(Boolean).join(" "),children:o}):o},e.key)})]},J(e,o))}),ne>0&&/* @__PURE__ */h("tr",{"aria-hidden":"true",children:/* @__PURE__ */h("td",{colSpan:we,style:{height:ne,padding:0,border:0}})})]}):/* @__PURE__ */h("tr",{...Q("row"),className:U?"rosh-dt-empty":void 0,children:/* @__PURE__ */h("td",{...Q("cell"),colSpan:we,className:`${Ne} py-10 text-center text-gray-500`,children:W})})})]}),F]}),j&&j.pageCount>1&&/* @__PURE__ */h("div",{className:U?"rosh-dt-pager mt-3 flex justify-end":"mt-3 flex justify-end",children:/* @__PURE__ */h(e,{page:j.page,pageCount:j.pageCount,onPageChange:j.onPageChange})})]});/* @__PURE__ */
|
|
20
|
+
return h("div",U?void 0!==P&&P>0&&40!==P?{className:`rosh-dt-at ${G}`.trim(),children:/* @__PURE__ */h("div",{className:"rosh-dt-stack",style:{width:40/P*100+"%"},children:/* @__PURE__ */h("div",{className:"rosh-dt-fit",style:{width:P/40*100+"%"},children:Se})})}:{className:`rosh-dt-stack ${G}`.trim(),children:Se}:{className:G,children:Se})}export{x as DataTable};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import{Tree as e,TreeRow as n,TreeGroup as l}from"./chunk-42GNFUAP.js";import{MarqueeBox as r}from"./chunk-IC72MGON.js";import{EmptyState as a}from"./chunk-LQD54ZL5.js";import{ImageLightbox as i}from"./chunk-QV5A7NFQ.js";import{DescriptionList as t}from"./chunk-SACUSHVN.js";import{Drawer as o}from"./chunk-CHV7U5UV.js";import{Breadcrumbs as d}from"./chunk-GL4NELAT.js";import{ROOT_KEY as s,mediaLibraryMenu as c}from"./chunk-4FUQK2LK.js";import{useMediaMoveItems as u}from"./chunk-YNE5YC6E.js";import{RenameField as m}from"./chunk-QIPO4EVJ.js";import{NativeSelect as p}from"./chunk-LHATGPIE.js";import{MediaUploadGrid as h}from"./chunk-O3SCB4QZ.js";import{MediaUsedInList as f}from"./chunk-FYGPJPU7.js";import{Segmented as g}from"./chunk-HNIIDDLJ.js";import{useGridSelection as v}from"./chunk-VLKDWKVR.js";import{useMarquee as k}from"./chunk-OLFYNMTD.js";import{copyToClipboard as y}from"./chunk-WM37FXRK.js";import{Checkbox_default as b}from"./chunk-CGZBDI6C.js";import{useContextMenu as w,ContextMenu as x}from"./chunk-QMBMK6PP.js";import{Banner as C}from"./chunk-6UB6YY3H.js";import{Input_default as N}from"./chunk-PT4GMPUB.js";import{DropdownMenu as I}from"./chunk-3DSGJIC7.js";import{IconButton_default as D}from"./chunk-SV5RRBVA.js";import{useFileIntake as S,FileIntakeAlert as j}from"./chunk-VREZFFRE.js";import{setModalDragAside as F,modalIdHolding as L}from"./chunk-EIFNESXS.js";import{ColoredBadge as z}from"./chunk-SAAXAAAH.js";import{Button_default as E}from"./chunk-EVYD6UFQ.js";import{Icon as T}from"./chunk-ISVODSRP.js";import{Tooltip as O}from"./chunk-SOZCWT6I.js";import{buttonClasses as P}from"./chunk-UQYNPYF4.js";import{usePlotWidth as A}from"./chunk-MAFUXCPZ.js";import{useShellStrings as U}from"./chunk-HCDG7EUR.js";import{useRef as M,useMemo as R,useCallback as V,useState as B,useEffect as K}from"react";import{jsxs as G,Fragment as H,jsx as Q}from"react/jsx-runtime";var Y="application/x-efficient-media-files",J="application/x-efficient-media-folder",$="application/x-efficient-media-file";function W(e){if(!e||!Array.from(e.types).includes($))return null;try{const n=JSON.parse(e.getData($));if(n&&"string"==typeof n.id&&"string"==typeof n.url&&"string"==typeof n.name&&("image"===n.kind||"video"===n.kind))return{id:n.id,url:n.url,kind:n.kind,name:n.name}}catch{}return null}var Z={type:"all",use:"any",sort:"newest"},q={lock:/* @__PURE__ */Q(T,{name:"lock","aria-hidden":"true",className:"h-4 w-4"}),folder:/* @__PURE__ */Q(T,{name:"folder","aria-hidden":"true",className:"h-4 w-4"}),folderOpen:/* @__PURE__ */Q(T,{name:"folder-open","aria-hidden":"true",className:"h-4 w-4"}),folderPlus:/* @__PURE__ */Q(T,{name:"folder-plus","aria-hidden":"true",className:"h-4 w-4"}),trash:/* @__PURE__ */Q(T,{name:"trash","aria-hidden":"true",className:"h-4 w-4"}),upload:/* @__PURE__ */Q(T,{name:"upload","aria-hidden":"true",className:"h-4 w-4"}),search:/* @__PURE__ */Q(T,{name:"search","aria-hidden":"true",className:"h-4 w-4"}),grid:/* @__PURE__ */Q(T,{name:"grid","aria-hidden":"true",className:"h-4 w-4"}),list:/* @__PURE__ */Q(T,{name:"list","aria-hidden":"true",className:"h-4 w-4"}),more:/* @__PURE__ */Q(T,{name:"more","aria-hidden":"true",className:"h-4 w-4"}),copy:/* @__PURE__ */Q(T,{name:"copy","aria-hidden":"true",className:"h-4 w-4"}),edit:/* @__PURE__ */Q(T,{name:"edit","aria-hidden":"true",className:"h-4 w-4"}),swap:/* @__PURE__ */Q(T,{name:"swap","aria-hidden":"true",className:"h-4 w-4"}),crop:/* @__PURE__ */Q(T,{name:"crop","aria-hidden":"true",className:"h-4 w-4"}),external:/* @__PURE__ */Q(T,{name:"external","aria-hidden":"true",className:"h-4 w-4"}),undo:/* @__PURE__ */Q(T,{name:"undo","aria-hidden":"true",className:"h-4 w-4"})},X={link:/* @__PURE__ */Q(T,{name:"link","aria-hidden":"true",className:"h-3 w-3"}),email:/* @__PURE__ */Q(T,{name:"email","aria-hidden":"true",className:"h-3 w-3"}),lock:/* @__PURE__ */Q(T,{name:"lock","aria-hidden":"true",className:"h-3 w-3"}),clock:/* @__PURE__ */Q(T,{name:"clock","aria-hidden":"true",className:"h-3 w-3"})};function _(T){const{mode:W="manage",layout:_="auto",location:ee,onLocationChange:ne,folders:le,products:re,allFilesCount:ae,trashCount:ie,files:te,query:oe,onQueryChange:de,filters:se=Z,onFiltersChange:ce,extraFilters:ue,view:me="grid",onViewChange:pe,selectedIds:he,onSelectionChange:fe,usedIn:ge,denied:ve={},accept:ke="image/*,video/*",maxSizeBytes:ye,busy:be,progress:we,onUpload:xe,onNewFolder:Ce,onRename:Ne,onMove:Ie,onTrash:De,onDeleteFolder:Se,onRestore:je,onDeleteForever:Fe,onEmptyTrash:Le,onReplace:ze,onCropEdit:Ee,onOpenInDesign:Te,onChoose:Oe,onCancel:Pe,pickNote:Ae,onDragOut:Ue,className:Me=""}=T,Re=U().mediaLibrary,Ve=U().media,Be="pick"===W,Ke=!Be,Ge=M(null),He=A(Ge,"phone"===_?343:1200),Qe="phone"===_||"auto"===_&&He<640,Ye=R(()=>function(e=[]){const n=/* @__PURE__ */new Map,l=(e,r)=>{for(const a of e){const e=[...r,a];n.set(a.id,{node:a,path:e}),a.children&&l(a.children,e)}};return l(e,[]),n}(re),[re]),Je=R(()=>new Map(le.map(e=>[e.id,e])),[le]),$e=R(()=>{const e=/* @__PURE__ */new Map;for(const n of le){const l=n.parentId&&Je.has(n.parentId)?n.parentId:null;e.set(l,[...e.get(l)??[],n])}return e},[le,Je]),We=V(e=>{const n=[];for(let l=e?Je.get(e):void 0;l&&(n.unshift(l),!(n.length>le.length));l=l.parentId?Je.get(l.parentId):void 0);return n},[Je,le.length]),Ze=V((e,n)=>We(e).some(e=>e.id===n),[We]),[qe,Xe]=B(()=>/* @__PURE__ */new Set(["@files"])),_e=e=>Xe(n=>{const l=new Set(n);return l.has(e)?l.delete(e):l.add(e),l}),en=V(e=>{Xe(n=>e.every(e=>n.has(e))?n:/* @__PURE__ */new Set([...n,...e]))},[]),nn="files"===(ln=ee).place?`files:${ln.folderId??""}`:"products"===ln.place?`products:${ln.nodeId??""}`:"trash";var ln;K(()=>{if("files"===ee.place)en(["@files",...We(ee.folderId).slice(0,-1).map(e=>e.id)]);else if("products"===ee.place){const e=ee.nodeId?Ye.get(ee.nodeId)?.path??[]:[];en(["@products",...e.slice(0,-1).map(e=>`p:${e.id}`)])}},[nn]);const rn="products"===ee.place,an="trash"===ee.place,tn="files"===ee.place,on=tn?ee.folderId:null,dn=rn&&ee.nodeId?Ye.get(ee.nodeId)?.path[0]:void 0,sn=e=>e?.sharedFrom?`${Re.readOnly} ${Re.editedAtHq(e.sharedFrom)}`:Re.readOnly,cn=R(()=>te.map(e=>e.id),[te]),un=R(()=>new Map(te.map(e=>[e.id,e])),[te]),mn=v(cn),pn=R(()=>cn.filter(e=>mn.selected.has(e)),[cn,mn.selected]),hn=1===pn.length?un.get(pn[0]):void 0,fn=M(!0);K(()=>{fn.current?fn.current=!1:mn.clear()},[nn]);const gn=he?.join("\0");K(()=>{he&&mn.setSelection(he)},[gn]);const vn=M(gn??""),kn=pn.join("\0");K(()=>{vn.current!==kn&&(vn.current=kn,fe?.(pn))},[kn]);const yn=(e,n={})=>{Be?mn.select(e):mn.select(e,{ctrl:!(!n.ctrlKey&&!n.metaKey),shift:!!n.shiftKey})},[bn,wn]=B(null),xn=e=>{const n=bn;if(wn(null),!n||null==e)return;e!==("folder"===n.kind?Je.get(n.id)?.name:un.get(n.id)?.name)&&Ne?.(n,e)},Cn=async e=>{if(!Ce)return;const n=await Ce(e);en(["@files",...e?[e]:[]]),"string"==typeof n&&wn({kind:"folder",id:n})},Nn=V(e=>{const n=[],l=n=>{if("files"===e.kind)return n===on&&tn?Re.alreadyHere:void 0;const l=Je.get(e.id);return n===e.id||n&&Ze(n,e.id)?Re.notIntoItself:(l?.parentId??null)===n?Re.folderAlreadyHere:void 0};n.push({key:s,label:Re.allFiles,disabledReason:l(null)});const r=(e,a)=>{for(const i of $e.get(e)??[])n.push({key:i.id,label:i.name,depth:a,disabledReason:l(i.id)}),r(i.id,a+1)};return r(null,1),n},[$e,Je,tn,Ze,on,Re]),In=V(e=>{const n=new Set(e.map(e=>un.get(e)?.kind??"image"));return 1===n.size?[...n][0]:"file"},[un]),[Dn,Sn]=B(null),jn={words:Re,media:Ve,denied:ve,moveTargets:Nn,kindOf:In,urlOf:e=>un.get(e)?.url,newSubfolder:Ce&&Ke?e=>{Cn(e)}:void 0,rename:Ne&&Ke?e=>{"file"!==e.kind||mn.isSelected(e.id)||mn.select(e.id),wn(e)}:void 0,move:Ie&&Ke?Ie:void 0,trash:De&&Ke?De:void 0,deleteFolder:Se&&Ke?Se:void 0,folderNotEmpty:e=>!!Je.get(e)?.notEmpty,replace:ze&&Ke?ze:void 0,copyUrl:e=>{const n=un.get(e)?.url;n&&y(Re.urlLabel,n)},openInDesign:Te,restore:je,deleteForever:Fe},Fn=e=>c(e,jn),Ln=w(),zn=(e,n)=>{Be||(mn.isSelected(e)||mn.select(e),Ln.open(n,(e=>{const n=mn.isSelected(e)?pn:[e];return rn?{kind:"render",id:e}:an?{kind:"trashed",ids:n}:{kind:"files",ids:n}})(e)))},[En,Tn]=B(null),[On,Pn]=B(null),[An,Un]=B(null);K(()=>{if(!On&&!En)return;const e=()=>{Pn(null),Tn(null)};return window.addEventListener("dragend",e),window.addEventListener("drop",e),()=>{window.removeEventListener("dragend",e),window.removeEventListener("drop",e)}},[On,En]);const Mn=(e,n)=>Array.from(e.dataTransfer?.types??[]).includes(n),Rn=(e,n)=>!(!Ie||ve.move||Be)&&(!!Mn(e,Y)||!(!Mn(e,J)||!An)&&(n!==An&&!(n&&Ze(n,An)))),Vn=(e,n)=>({onDragEnter:l=>{Rn(l,n)&&(l.preventDefault(),Tn(e))},onDragOver:l=>{Rn(l,n)&&(l.preventDefault(),l.dataTransfer.dropEffect="move",En!==e&&Tn(e))},onDragLeave:n=>{const l=n.relatedTarget;l&&n.currentTarget.contains(l)||Tn(n=>n===e?null:n)},onDrop:e=>{if(Rn(e,n))if(e.preventDefault(),Tn(null),Mn(e,Y)){let l;try{l=JSON.parse(e.dataTransfer.getData(Y))}catch{l=null}Array.isArray(l)&&l.length&&Ie({kind:"files",ids:l.map(String)},n)}else An&&(Ie({kind:"folder",id:An},n),Un(null))}}),Bn=e=>{const n=e=>Mn(e,Y)||Mn(e,J)||Mn(e,"Files");return{onDragEnter:l=>{n(l)&&Pn(e)},onDragOver:l=>{n(l)&&On!==e&&Pn(e)},onDragLeave:n=>{const l=n.relatedTarget;l&&n.currentTarget.contains(l)||Pn(n=>n===e?null:n)}}},Kn=(e,n,l)=>/* @__PURE__ */Q(O,{side:"right",content:On===e?Re.noDropProducts:sn(l),open:On===e||!On&&void 0,children:/* @__PURE__ */Q("span",{children:n})}),Gn=e=>({onContextMenu:n=>{Ln.open(n,e)}}),Hn=(e,r,a)=>e.map(e=>{const i=`p:${e.id}`,t=a??e,o=qe.has(i),d=e.children?.length?e.children:null;/* @__PURE__ */
|
|
2
|
+
return G("div",{role:"none",className:"contents",children:[
|
|
3
|
+
/* @__PURE__ */Q(n,{label:Kn(i,e.name,t),level:r,icon:d&&o?q.folderOpen:q.folder,count:e.count,countLabel:null!=e.count?e.countLabel??Re.fileCount(e.count):void 0,selected:rn&&ee.nodeId===e.id,expanded:d?o:void 0,onToggle:d?()=>_e(i):void 0,onSelect:()=>ne({place:"products",nodeId:e.id}),rowProps:{"data-media-row":i,...Bn(i),...Ke?Gn({kind:"product-node",id:e.id}):{}}}),d&&o&&/* @__PURE__ */Q(l,{children:Hn(d,r+1,t)})]},e.id)}),Qn=(e,r)=>($e.get(e)??[]).map(e=>{const a=$e.get(e.id),i=qe.has(e.id),t="folder"===bn?.kind&&bn.id===e.id,o=Fn({kind:"folder",id:e.id});/* @__PURE__ */
|
|
4
|
+
return G("div",{role:"none",className:"contents",children:[
|
|
5
|
+
/* @__PURE__ */Q(n,{label:e.name,level:r,icon:a&&i?q.folderOpen:q.folder,count:e.count,countLabel:null!=e.count?e.countLabel??Re.fileCount(e.count):void 0,selected:t||tn&&ee.folderId===e.id,expanded:a?i:void 0,onToggle:a?()=>_e(e.id):void 0,onSelect:()=>ne({place:"files",folderId:e.id}),drop:En===e.id?"into":void 0,dragging:An===e.id,draggable:Ke&&!!Ie&&!ve.move,rename:t?/* @__PURE__ */Q(m,{value:e.name,label:Re.folderName,onDone:xn}):void 0,actions:Ke&&o.length?/* @__PURE__ */Q(I,{align:"end","aria-label":Re.folderActions,trigger:q.more,items:o}):void 0,rowProps:{"data-media-row":e.id,...Vn(e.id,e.id),...Ke?Gn({kind:"folder",id:e.id}):{},...Ke&&Ie&&!ve.move?{draggable:!0,onDragStart:n=>{n.dataTransfer.effectAllowed="move",n.dataTransfer.setData(J,e.id),Un(e.id)},onDragEnd:()=>{Un(null),Tn(null)}}:{}}}),a&&i&&/* @__PURE__ */Q(l,{children:Qn(e.id,r+1)})]},e.id)}),Yn=qe.has("@files"),Jn=qe.has("@products"),$n=/* @__PURE__ */G(e,{"aria-label":Re.folders,children:[re&&/* @__PURE__ */G(H,{children:[
|
|
6
|
+
/* @__PURE__ */Q(n,{label:Kn("@products",Re.products),level:1,icon:q.lock,badge:{label:Re.readOnlyBadge,tone:"neutral"},expanded:re.length?Jn:void 0,onToggle:()=>_e("@products"),selected:rn&&null==ee.nodeId,onSelect:()=>ne({place:"products",nodeId:null}),rowProps:{"data-media-row":"@products",...Bn("@products")}}),Jn&&re.length>0&&/* @__PURE__ */Q(l,{children:Hn(re,2)})]}),
|
|
7
|
+
/* @__PURE__ */Q(n,{label:Re.allFiles,level:1,icon:Yn?q.folderOpen:q.folder,count:ae,countLabel:null!=ae?Re.fileCount(ae):void 0,expanded:$e.get(null)?.length?Yn:void 0,onToggle:()=>_e("@files"),selected:tn&&null==ee.folderId,onSelect:()=>ne({place:"files",folderId:null}),drop:"@files"===En?"into":void 0,rowProps:{"data-media-row":"@files",...Vn("@files",null)}}),Yn&&($e.get(null)?.length??0)>0&&/* @__PURE__ */Q(l,{children:Qn(null,2)}),Ke&&/* @__PURE__ */Q(n,{label:Re.trash,level:1,icon:q.trash,count:ie,countLabel:null!=ie?Re.fileCount(ie):void 0,selected:an,onSelect:()=>ne({place:"trash"}),rowProps:{"data-media-row":"@trash"}})]}),Wn=(()=>{if(an)return[{label:Re.trash}];if(rn){const e=ee.nodeId?Ye.get(ee.nodeId)?.path??[]:[];return[{label:Re.products,onClick:e.length?()=>ne({place:"products",nodeId:null}):void 0},...e.map((n,l)=>({label:n.name,onClick:l<e.length-1?()=>ne({place:"products",nodeId:n.id}):void 0}))]}const e=We(on);return[{label:Re.allFiles,onClick:e.length?()=>ne({place:"files",folderId:null}):void 0},...e.map((n,l)=>({label:n.name,onClick:l<e.length-1?()=>ne({place:"files",folderId:n.id}):void 0}))]})(),Zn=rn?Re.readOnly:ve.upload,qn=!!xe&&!an&&!Zn,Xn=S({accept:ke,maxSizeBytes:ye,multiple:!0,disabled:!qn,onAccept:e=>xe?.(e,on)}),_n=rn?Re.noProductFolder:ve.newFolder,el=e=>e?{"aria-disabled":!0,disabledReason:e}:{},nl=/* @__PURE__ */G("div",{className:"flex flex-wrap items-center gap-2",children:[Ke&&Ce&&!an&&/* @__PURE__ */Q(E,{variant:"secondary",size:"sm",leftIcon:q.folderPlus,onClick:()=>{Cn(on)},...el(_n),children:Re.newFolder}),xe&&!an&&/* @__PURE__ */Q(E,{variant:"primary",size:"sm",leftIcon:q.upload,onClick:()=>Xn.open(),...el(Zn),children:Re.upload}),Ke&&an&&Le&&te.length>0&&/* @__PURE__ */Q(E,{variant:"danger",size:"sm",onClick:Le,...el(ve.deleteForever),children:Re.emptyTrash})]}),ll=(e,n,l,r,a)=>/* @__PURE__ */Q("div",{style:{width:Qe?void 0:a,flex:Qe?"1 1 120px":"0 0 auto",minWidth:0},children:/* @__PURE__ */Q(p,{size:"sm","aria-label":e,value:n,onChange:r,options:l})},e),rl=e=>n=>ce?.({...se,[e]:n}),al=/* @__PURE__ */G("div",{className:"flex flex-wrap items-center gap-2",children:[de&&/* @__PURE__ */Q("div",{style:{flex:"1 1 200px",minWidth:0},children:/* @__PURE__ */Q(N,{size:"sm",type:"search",leftIcon:q.search,placeholder:rn?Re.searchProducts:Re.search,"aria-label":rn?Re.searchProducts:Re.search,value:oe??"",onChange:e=>de(e.target.value)})}),ce&&ll(Re.mediaType,se.type,[{value:"all",label:Re.allTypes},{value:"image",label:Re.images},{value:"video",label:Re.videos},{value:"svg",label:"SVG"},{value:"gif",label:"GIF"}],rl("type"),130),ce&&!rn&&!an&&ll(Re.use,se.use,[{value:"any",label:Re.anyUse},{value:"email",label:Re.emailOnly},{value:"website",label:Re.websiteOnly},{value:"unused",label:Re.notUsed}],rl("use"),130),ce&&Ke&&ll(Re.sort,se.sort,[{value:"newest",label:Re.newest},{value:"name",label:Re.byName},{value:"size",label:Re.bySize}],rl("sort"),110),ue?.map(e=>ll(e.label,e.value,e.options,e.onChange,120)),pe&&/* @__PURE__ */Q(g,{size:"sm",label:Re.view,value:me,onChange:pe,options:[{value:"grid",label:Re.grid,icon:q.grid},{value:"list",label:Re.list,icon:q.list}]})]}),il=e=>{const n=[];return null!=e.trashedDaysAgo&&n.push({key:"t",label:Re.daysAgo(e.trashedDaysAgo),count:e.trashedDaysAgo,icon:X.clock,tone:"neutral"}),e.usedCount&&n.push({key:"u",label:Re.used(e.usedCount),count:e.usedCount,icon:X.link,tone:"active"}),e.email&&n.push({key:"e",label:Re.email,icon:X.email,tone:"queued"}),e.private&&n.push({key:"p",label:Re.private,icon:X.lock,tone:"neutral"}),n},tl=e=>il(e).map(e=>/* @__PURE__ */Q(z,{tone:e.tone,size:"xs",children:e.label},e.key)),ol=Ke&&tn&&!!Ie&&!ve.move,dl=!!Ue&&!an,sl=M(""),cl=M(null),ul=()=>cl.current?.dropped?"dropped":"cancelled",ml=M(Ue);ml.current=Ue;const pl=V(e=>{const n=cl.current;n&&(cl.current=null,n.stop(),F(sl.current,!1),e&&ml.current?.(e))},[]),hl=V(e=>{pl(ul());const n=Ge.current?.ownerDocument;if(!n)return;sl.current=L(Ge.current);const l=Ge.current?.closest("[data-modal-panel]"),r=e=>{sl.current&&!l?.contains(e.target)&&F(sl.current,!0)},a=()=>!!e&&!e.isConnected,i=()=>{const e=cl.current;if(e){if(a())return pl("dropped");e.dropped=!0,F(sl.current,!1)}},t=e=>{const n=e.dataTransfer?.dropEffect;pl(n&&"none"!==n?"dropped":a()?ul():"cancelled")},o=()=>{a()&&pl(ul())},d=["pointermove","pointerdown","mousemove","mousedown"];n.addEventListener("dragover",r,!0),n.addEventListener("drop",i,!0),n.addEventListener("dragend",t,!0);for(const e of d)n.addEventListener(e,o,!0);cl.current={dropped:!1,stop:()=>{n.removeEventListener("dragover",r,!0),n.removeEventListener("drop",i,!0),n.removeEventListener("dragend",t,!0);for(const e of d)n.removeEventListener(e,o,!0)}}},[pl]);K(()=>()=>pl(ul()),[pl]);const fl=(e,n,l)=>{if("start"!==e)return;const r=un.get(n);r&&gl(r)&&(hl(l??null),Ue(e))},gl=e=>!dl||e.private||e.pickDisabledReason?void 0:JSON.stringify({id:e.id,url:e.url,kind:"video"===e.kind?"video":"image",name:e.name}),vl=te.map(e=>({id:e.id,url:e.thumbUrl??e.url,name:e.name,kind:e.kind,caption:e.name,badges:il(e),dragData:ol?JSON.stringify(mn.isSelected(e.id)?pn:[e.id]):gl(e),...ol&&gl(e)?{dragAlso:{[$]:gl(e)}}:{}})),kl=Qe?Math.max(72,Math.floor((He-24-16-1)/3)):112,yl=M(null),bl=k({containerRef:yl,enabled:Ke&&!Qe&&te.length>0,selected:mn.selected,setSelection:e=>mn.setSelection(e),clearSelection:mn.clear}),wl=e=>{if(Be){const n=un.get(e);return void(!n||n.private||n.pickDisabledReason||Oe?.(n))}const n=cn.indexOf(e);n>=0&&Sn(n)},xl=te.length?null:oe?/* @__PURE__ */Q(a,{variant:"dashed",title:Re.noMatches}):rn?/* @__PURE__ */Q(a,{variant:"dashed",title:Re.emptyProducts,description:sn(dn)}):an?/* @__PURE__ */Q(a,{variant:"dashed",title:Re.trashEmpty}):!qn||Be?/* @__PURE__ */Q(a,{variant:"dashed",title:Re.emptyFolder}):null,Cl="list"===me&&te.length>0,Nl=xl??(Cl?/* @__PURE__ */Q("ul",{role:"listbox","aria-multiselectable":Ke||void 0,"aria-label":Re.folders,className:"flex flex-col gap-1",children:te.map(e=>/* @__PURE__ */G("li",{role:"option","aria-selected":mn.isSelected(e.id),tabIndex:0,"data-grid-item":"","data-grid-id":e.id,onClick:n=>yn(e.id,n),onDoubleClick:()=>wl(e.id),onContextMenu:n=>zn(e.id,n),draggable:!!gl(e)||void 0,onDragStart:gl(e)?n=>{n.dataTransfer.effectAllowed="link",n.dataTransfer.setData($,gl(e)),fl("start",e.id,n.currentTarget)}:void 0,onKeyDown:n=>{"Enter"!==n.key&&" "!==n.key||(n.preventDefault(),yn(e.id,n))},className:"flex h-12 cursor-pointer items-center gap-3 rounded-md px-2 text-sm rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] "+(mn.isSelected(e.id)?"bg-accent-tint text-blue-700":"text-ink hover:bg-gray-100"),children:[
|
|
8
|
+
/* @__PURE__ */Q("img",{src:e.thumbUrl??e.url,alt:"",className:"h-10 w-10 shrink-0 rounded bg-gray-100 object-contain"}),
|
|
9
|
+
/* @__PURE__ */Q("span",{className:"min-w-0 flex-1 truncate",children:e.name}),
|
|
10
|
+
/* @__PURE__ */Q("span",{className:"flex shrink-0 items-center gap-1",children:tl(e)}),e.sizeLabel&&/* @__PURE__ */Q("span",{className:"w-16 shrink-0 text-right text-xs text-ink-faint",children:e.sizeLabel})]},e.id))}):/* @__PURE__ */Q(h,{items:vl,readOnly:!qn||Be,onFiles:qn&&!Be?e=>xe(e,on):void 0,accept:ke,maxSizeBytes:ye,busy:be,progress:we,fit:"contain",thumbSize:kl,dragType:ol?Y:dl?$:void 0,onDragOutChange:dl?(e,n,l)=>fl(e,n,l):void 0,selected:mn.selected,onItemClick:yn,onItemDoubleClick:wl,onItemContextMenu:Ke?zn:void 0,menuOnMedia:Ke})),Il=u({count:pn.length,kind:In(pn),targets:Nn({kind:"files",ids:pn}),onPick:e=>Ie?.({kind:"files",ids:pn},e.key===s?null:e.key)}),Dl=P({variant:"secondary",size:"sm"}),Sl=/* @__PURE__ */Q(I,{align:"start",triggerClassName:Dl,trigger:/* @__PURE__ */G(H,{children:[q.folder,Re.moveTo]}),items:Il,disabled:!!ve.move}),jl=Ke&&pn.length>1&&!rn?/* @__PURE__ */G("div",{"data-media-bulk":"",className:"flex flex-wrap items-center gap-2 rounded-lg border border-line px-3 py-2",children:[
|
|
11
|
+
/* @__PURE__ */Q(b,{checked:pn.length===te.length,indeterminate:pn.length<te.length,onChange:e=>e?mn.selectAll():mn.clear(),label:Re.selected(pn.length)}),/* @__PURE__ */G(H,an?{children:[je&&/* @__PURE__ */Q(E,{variant:"secondary",size:"sm",leftIcon:q.undo,onClick:()=>je(pn),...el(ve.restore),children:Re.restore}),Fe&&/* @__PURE__ */Q(E,{variant:"secondary-danger",size:"sm",onClick:()=>Fe(pn),...el(ve.deleteForever),children:Re.deleteForever})]}:{children:[Ie&&Sl,Ne&&/* @__PURE__ */Q(E,{variant:"secondary",size:"sm",leftIcon:q.edit,disabled:!0,children:Re.rename}),De&&/* @__PURE__ */Q(E,{variant:"secondary",size:"sm",leftIcon:q.trash,onClick:()=>De({kind:"files",ids:pn}),...el(ve.trash),children:Re.moveFilesToTrash(pn.length)})]}),
|
|
12
|
+
/* @__PURE__ */Q(E,{variant:"ghost",size:"sm",onClick:mn.clear,children:Re.clearSelection})]}):null,Fl=e=>{const n=[],l=(e,l,r)=>{null!=r&&""!==r&&n.push({key:e,label:l,value:r})},r="file"===bn?.kind&&bn.id===e.id;l("name",Re.name,r?/* @__PURE__ */Q(m,{value:e.name,label:Re.fileName,onDone:xn}):e.name),l("type",Re.type,e.typeLabel),l("size",Re.size,e.sizeLabel),l("resolution",Re.resolution,e.resolution),rn?(l("design",Re.design,e.design),l("finish",Re.finish,e.finish),l("angle",Re.angleLug,e.angleLug),l("owner",Re.owner,e.owner)):(l("added",Re.addedBy,e.addedBy),l("folder",Re.folder,e.folderPath)),l("used",Re.usedIn,null!=e.usedCount?Re.places(e.usedCount):void 0);const a=c({kind:"files",ids:[e.id]},jn).find(e=>"submenu"===e.type);/* @__PURE__ */
|
|
13
|
+
return G("div",{"data-media-details":"",className:"flex flex-col gap-3",children:[
|
|
14
|
+
/* @__PURE__ */Q("img",{src:e.url,alt:e.name,className:"aspect-square w-full rounded-lg bg-gray-100 object-contain"}),rn&&/* @__PURE__ */Q(C,{tone:"neutral",title:Re.readOnlyBadge,children:sn(dn)}),
|
|
15
|
+
/* @__PURE__ */Q(t,{size:"sm",columns:1,items:n}),!an&&/* @__PURE__ */G("div",{className:"flex gap-2",children:[
|
|
16
|
+
/* @__PURE__ */Q("div",{style:{flex:"1 1 0",minWidth:0},children:/* @__PURE__ */Q(N,{size:"sm",readOnly:!0,value:e.url,"aria-label":Re.fileUrl,onFocus:e=>e.currentTarget.select()})}),
|
|
17
|
+
/* @__PURE__ */Q(E,{variant:"secondary",size:"sm",leftIcon:q.copy,onClick:()=>jn.copyUrl(e.id),children:Re.copyUrl})]}),tn&&Ke&&/* @__PURE__ */G("div",{className:"flex flex-wrap gap-2",children:[ze&&/* @__PURE__ */Q(E,{variant:"secondary",size:"sm",leftIcon:q.swap,onClick:()=>ze(e.id),...el(ve.replace),children:Re.replace}),Ee&&/* @__PURE__ */Q(E,{variant:"secondary",size:"sm",leftIcon:q.crop,onClick:()=>Ee(e.id),children:Re.cropEdit}),Ie&&"submenu"===a?.type&&/* @__PURE__ */Q(I,{align:"start",triggerClassName:Dl,trigger:/* @__PURE__ */G(H,{children:[q.folder,Re.moveTo]}),items:a.items,disabled:!!ve.move}),Ne&&/* @__PURE__ */Q(E,{variant:"secondary",size:"sm",leftIcon:q.edit,onClick:()=>wn({kind:"file",id:e.id}),...el(ve.rename),children:Re.rename}),De&&/* @__PURE__ */Q(D,{"aria-label":Re.moveToTrash,size:"sm",onClick:()=>De({kind:"files",ids:[e.id]}),disabledReason:ve.trash,"aria-disabled":!!ve.trash||void 0,children:q.trash})]}),an&&Ke&&/* @__PURE__ */G("div",{className:"flex flex-wrap gap-2",children:[je&&/* @__PURE__ */Q(E,{variant:"primary",size:"sm",leftIcon:q.undo,onClick:()=>je([e.id]),...el(ve.restore),children:Re.restore}),Fe&&/* @__PURE__ */Q(E,{variant:"danger",size:"sm",onClick:()=>Fe([e.id]),...el(ve.deleteForever),children:Re.deleteForever})]}),rn&&Te&&/* @__PURE__ */Q(E,{variant:"secondary",size:"sm",leftIcon:q.external,onClick:()=>Te({kind:"render",id:e.id}),children:Re.openInDesign}),ge&&/* @__PURE__ */Q(f,{items:ge})]})},Ll=hn?hn.private?Re.privateNoPick:hn.pickDisabledReason:void 0,zl=Be?/* @__PURE__ */G("div",{"data-media-picker-footer":"",className:"flex flex-wrap items-center justify-between gap-2 border-t border-line px-3 py-2",children:[
|
|
18
|
+
/* @__PURE__ */Q("span",{className:"min-w-0 truncate text-sm text-ink-faint",children:hn?Re.oneChosen(hn.name):Re.noneChosen}),
|
|
19
|
+
/* @__PURE__ */G("div",{className:"flex gap-2",children:[Pe&&/* @__PURE__ */Q(E,{variant:"secondary",size:"sm",onClick:Pe,children:Re.cancel}),
|
|
20
|
+
/* @__PURE__ */Q(E,{variant:"primary",size:"sm",disabled:!hn,...el(Ll),onClick:()=>{hn&&!Ll&&Oe?.(hn)},children:Re.chooseImage})]})]}):null,El=Ke&&!!hn,Tl=/* @__PURE__ */G("div",{className:"flex min-w-0 flex-col gap-3",children:[Ae&&/* @__PURE__ */Q(C,{tone:"neutral",children:Ae}),
|
|
21
|
+
/* @__PURE__ */G("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[
|
|
22
|
+
/* @__PURE__ */Q(d,{items:Wn}),nl]}),al,jl,
|
|
23
|
+
/* @__PURE__ */G("div",{ref:yl,className:"relative",onPointerDown:bl.onPointerDown,onKeyDown:e=>{Ke&&(e.ctrlKey||e.metaKey)&&"a"===e.key.toLowerCase()?(e.preventDefault(),mn.selectAll()):"Escape"===e.key&&mn.size&&mn.clear()},children:[Nl,
|
|
24
|
+
/* @__PURE__ */Q(r,{rect:bl.rect})]}),qn&&/* @__PURE__ */Q("input",{...Xn.inputProps}),
|
|
25
|
+
/* @__PURE__ */Q(j,{rejections:Xn.rejections})]});/* @__PURE__ */
|
|
26
|
+
return G("div",{ref:Ge,"data-media-library":"","data-layout":Qe?"phone":"wide",className:`flex h-full min-h-0 min-w-0 flex-col ${Me}`.trim(),children:[/* @__PURE__ */G("div",Qe?{className:"flex flex-col gap-3 p-3",children:[$n,Tl]}:{className:"flex min-h-0 min-w-0 flex-1",children:[
|
|
27
|
+
/* @__PURE__ */Q("div",{className:"shrink-0 overflow-y-auto border-r border-line p-3",style:{width:280,"--rosh-tree-ground":"var(--surface)"},children:$n}),
|
|
28
|
+
/* @__PURE__ */Q("div",{className:"min-w-0 flex-1 overflow-y-auto p-3",children:Tl}),El&&/* @__PURE__ */Q("div",{className:"shrink-0 overflow-y-auto border-l border-line p-3",style:{width:300},children:Fl(hn)})]}),zl,Qe&&/* @__PURE__ */Q(o,{open:El,onClose:mn.clear,side:"bottom",title:hn?.name,children:hn&&Fl(hn)}),Ln.state&&/* @__PURE__ */Q(x,{...Ln.props,items:Fn(Ln.state.data)}),null!=Dn&&te.length>0&&/* @__PURE__ */Q(i,{images:te.map(e=>({url:e.url,caption:e.name})),startIndex:Math.min(Dn,te.length-1),onClose:()=>Sn(null)})]})}export{Y as MEDIA_FILES_DRAG_TYPE,$ as MEDIA_FILE_DRAG_TYPE,J as MEDIA_FOLDER_DRAG_TYPE,_ as MediaLibrary,W as readMediaFileDrag};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{Segmented as e}from"./chunk-HNIIDDLJ.js";import{ImageFocusPoint as i}from"./chunk-
|
|
1
|
+
import{Segmented as e}from"./chunk-HNIIDDLJ.js";import{ImageFocusPoint as i}from"./chunk-3R2TMLKH.js";import{FormField as a}from"./chunk-6KBDNYRW.js";import{isVideoUrl as t,mediaPromptLine as r,mediaFileName as o,FilenameBadge as n,BusyOverlay as s,UploadGlyph as l,zoneFocusClass as c,dropzoneClass as d}from"./chunk-B27XRZ47.js";import{TransferProgress as u}from"./chunk-XMAOLCQV.js";import{useFileIntake as m,FileIntakeAlert as h}from"./chunk-VREZFFRE.js";import{Icon as p}from"./chunk-ISVODSRP.js";import{useShellStrings as b}from"./chunk-HCDG7EUR.js";import{useState as f,useRef as g,useEffect as v,useId as y}from"react";import{jsxs as k,jsx as x,Fragment as j}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:$,error:U,required:z,className:O,accept:P="image/*",maxSizeBytes:H,fit:D="cover",height:I,shape:q="rect",placeholder:B,cta:S,acceptHint:V,showFilename:E=!0,allowReplace:K=!0,allowRemove:A=!0,replaceLabel:M,removeLabel:W,busy:X=!1,busyLabel:Z,choosingLabel:_,pickFailedLabel:G,progress:J,disabled:Q=!1,kind:T,onKindChange:Y,focus:ee,onFocusChange:ie,focusLabel:ae}){const te=b().media,re="circle"===q,oe=I??(re?96:112),ne=S??te.cta,se=T??(/video/.test(P)&&!/image/.test(P)?"video":"image"),le="string"==typeof W&&W?W:te.remove,[ce,de]=f(!1),[ue,me]=f(!1),he=g(!0);v(()=>()=>{he.current=!1},[]);const pe=X||ce,be=ce&&!X?_??te.choosing:Z??te.uploading,fe=U??(ue?G??te.pickFailed:void 0),ge=e=>{if(!R)return;me(!1);const i=R(e);i&&"function"==typeof i.then&&(de(!0),i.then(e=>{he.current&&(de(!1),"string"==typeof e&&e&&L(e))},()=>{he.current&&(de(!1),me(!0))}))},ve=y(),ye=g(null),[ke,xe]=f(null);v(()=>()=>{ye.current&&URL.revokeObjectURL(ye.current)},[]);const je=Q||pe,Ne=!!w&&(t(w,P)||w===ke),we=B??r(P,te),Le=M??(Ne||"video"===se?te.changeVideo:te.changeImage),Re=e=>{R?ge(e):C?C(e):(e=>{ye.current&&URL.revokeObjectURL(ye.current);const i=URL.createObjectURL(e);ye.current=i,xe(e.type.startsWith("video/")?i:null),L(i)})(e)},Ce=m({accept:P,maxSizeBytes:H,acceptHint:V,multiple:!1,disabled:je,onAccept:([e])=>Re(e)}),{dragOver:Fe}=Ce,$e=()=>{je||(R?ge():Ce.open())},Ue=w?o(w):"",ze=!re&&!Ne&&!!ie,Oe=Q||!K&&!A?null:/* @__PURE__ */k("div",{"data-media-bar":"",className:[re?"absolute inset-0 flex items-center justify-center gap-1 p-1 text-(--status-on-solid)":"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:[K&&/* @__PURE__ */k("button",{id:ze?void 0:ve,type:"button","aria-labelledby":`${ve}-change`,onClick:()=>$e(),disabled:pe,className:re?`w-8 shrink-0 ${N}`:`min-w-0 flex-1 gap-1 px-2 text-sm font-medium ${N}`,children:[
|
|
2
2
|
/* @__PURE__ */x(p,{name:"swap","aria-hidden":"true",className:"h-4 w-4 shrink-0"}),
|
|
3
|
-
/* @__PURE__ */x("span",{id:`${ve}-change`,className:re?"sr-only":"truncate",children:Le})]}),
|
|
4
|
-
/* @__PURE__ */x(i,{value:ee??"",onChange:e=>ie?.(e),label:ae??te.focus,image:w,hint:null,id:ve,disabled:je,className:"[&_[data-image-focus-picture]]:rounded-none [&_[data-image-focus-picture]]:border-0"}):Ne?/* @__PURE__ */x("video",{src:w??void 0,muted:!0,playsInline:!0,preload:"metadata","aria-label":Ue||void 0,className:"h-full w-full",style:{objectFit:
|
|
3
|
+
/* @__PURE__ */x("span",{id:`${ve}-change`,className:re?"sr-only":"truncate",children:Le})]}),A&&/* @__PURE__ */x("button",{type:"button","aria-label":le,onClick:()=>{ye.current&&(URL.revokeObjectURL(ye.current),ye.current=null),xe(null),L("")},disabled:pe,className:`${re?"":"ml-auto "}w-8 shrink-0 ${N}`,children:/* @__PURE__ */x(p,{name:"trash","aria-hidden":"true",className:"h-4 w-4"})})]}),Pe=/* @__PURE__ */k("div",{...Ce.zoneProps,"data-media-frame":"",className:["group/media relative overflow-hidden border transition-colors",re?"shrink-0 rounded-full":"rounded-(--radius-control)",ze?"":"bg-gray-100",Fe?"border-blue-500":"border-line"].join(" "),style:ze?void 0:re?{height:oe,width:oe}:{height:oe},children:[ze?
|
|
4
|
+
/* @__PURE__ */x(i,{value:ee??"",onChange:e=>ie?.(e),label:ae??te.focus,image:w,hint:null,id:ve,disabled:je,className:"[&_[data-image-focus-picture]]:rounded-none [&_[data-image-focus-picture]]:border-0"}):Ne?/* @__PURE__ */x("video",{src:w??void 0,muted:!0,playsInline:!0,preload:"metadata","aria-label":Ue||void 0,className:"h-full w-full",style:{objectFit:D}}):/* @__PURE__ */x("img",{src:w??void 0,alt:Ue,className:"h-full w-full",style:{objectFit:D,objectPosition:ee||void 0}}),E&&!re&&w&&/* @__PURE__ */x(n,{children:Ue}),Oe,pe&&/* @__PURE__ */x(s,{label:be,progress:J,rounded:re?"rounded-full":"rounded-md"})]}),He=/* @__PURE__ */k(j,{children:[
|
|
5
5
|
/* @__PURE__ */x("span",{className:"px-3 text-xs text-ink-faint",children:we}),
|
|
6
|
-
/* @__PURE__ */x("span",{className:"text-sm font-medium text-blue-600",children:ne}),
|
|
7
|
-
/* @__PURE__ */x("span",{className:["flex shrink-0 items-center justify-center rounded-full border-2 border-dashed text-ink-faintest transition-colors"
|
|
8
|
-
/* @__PURE__ */x("span",{className:"flex min-w-0 flex-col items-start gap-1 [&>span]:px-0",children:pe?/* @__PURE__ */x(u,{state:"busy",verb:be,pct:
|
|
9
|
-
/* @__PURE__ */x("span",{className:"text-ink-faintest",children:/* @__PURE__ */x(l,{})}),
|
|
10
|
-
return k(a,{label
|
|
11
|
-
/* @__PURE__ */x(h,{rejections:
|
|
6
|
+
/* @__PURE__ */x("span",{className:"text-sm font-medium text-blue-600",children:ne}),V&&/* @__PURE__ */x("span",{className:"text-xs text-ink-faintest",children:V})]}),De=/* @__PURE__ */k("button",{type:"button",id:ve,onClick:()=>$e(),disabled:je,"aria-label":"string"==typeof we?we:te.upload,"aria-busy":pe||void 0,"aria-invalid":!!fe||void 0,"aria-required":z||void 0,"aria-describedby":fe?`${ve}-error`:$?`${ve}-hint`:void 0,...Ce.zoneProps,"data-media-circle":"",className:["group/zone flex w-full items-center gap-4 rounded-lg text-left",je?"cursor-not-allowed opacity-60":"cursor-pointer",c(je)].join(" "),children:[
|
|
7
|
+
/* @__PURE__ */x("span",{className:["flex shrink-0 items-center justify-center rounded-full border-2 border-dashed text-ink-faintest transition-colors",Fe?"border-accent-fill bg-accent-tint":"border-line-strong bg-surface-sunken group-hover/zone:bg-accent-tint"].join(" "),style:{height:oe,width:oe},children:/* @__PURE__ */x(l,{})}),
|
|
8
|
+
/* @__PURE__ */x("span",{className:"flex min-w-0 flex-col items-start gap-1 [&>span]:px-0",children:pe?/* @__PURE__ */x(u,{state:"busy",verb:be,pct:J}):He})]}),Ie=re?De:/* @__PURE__ */x("button",{type:"button",id:ve,onClick:()=>$e(),disabled:je,"aria-label":"string"==typeof we?we:te.upload,"aria-busy":pe||void 0,"aria-invalid":!!fe||void 0,"aria-required":z||void 0,"aria-describedby":fe?`${ve}-error`:$?`${ve}-hint`:void 0,...Ce.zoneProps,className:d(Fe,je,c(je)),style:{minHeight:oe},children:pe?/* @__PURE__ */x(u,{state:"busy",verb:be,pct:J}):/* @__PURE__ */k(j,{children:[
|
|
9
|
+
/* @__PURE__ */x("span",{className:"text-ink-faintest",children:/* @__PURE__ */x(l,{})}),He]})});/* @__PURE__ */
|
|
10
|
+
return k(a,{label:F,htmlFor:ve,hint:$,error:fe,required:z,className:O,children:[Y&&/* @__PURE__ */x("div",{"data-media-kind":"",className:"mb-2",children:/* @__PURE__ */x(e,{value:se,onChange:e=>Y(e),options:[{value:"image",label:te.image,icon:/* @__PURE__ */x(p,{name:"image","aria-hidden":"true",className:"h-4 w-4"}),disabled:je},{value:"video",label:te.video,icon:/* @__PURE__ */x(p,{name:"play","aria-hidden":"true",className:"h-4 w-4"}),disabled:je}],block:!0,size:"md",label:"string"==typeof F&&F?F:te.upload})}),w?Pe:Ie,!R&&/* @__PURE__ */x("input",{...Ce.inputProps}),
|
|
11
|
+
/* @__PURE__ */x(h,{rejections:Ce.rejections})]})}export{w as MediaUploadField};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import{useShellStrings as e}from"./chunk-
|
|
1
|
+
import{useShellStrings as e}from"./chunk-HCDG7EUR.js";import{jsxs as t,jsx as a,Fragment as l}from"react/jsx-runtime";var n=e=>"number"==typeof e?e:parseInt(String(e??""))||0;function s({items:s,getVolume:i,getInstructionVolume:r,getActualVolume:c,qtyField:m="instruction",showNewIndicator:d=!1,getInstructionQty:u=e=>e.quantity,getActualQty:h=e=>e.actual_qty,isFilled:o,isNew:g=e=>Boolean(e._isNew),className:x,style:f}){const p=e().containers,y=o?s.filter(o):s,N=e=>n(u(e)),b=e=>n(h(e)),w=y.some(e=>null!=h(e)&&b(e)>0),v=e=>w?N(e):"actual"===m?h(e)??u(e)??0:u(e)??0,M=y.reduce((e,t)=>e+n(v(t)),0),$=y.filter(e=>g(e)).length,k=y.filter(e=>g(e)).reduce((e,t)=>e+n(v(t)),0),j=y.reduce((e,t)=>e+N(t),0),I=y.reduce((e,t)=>e+b(t),0),V=e=>i?.(e)??0,q=r??(e=>V(e)*N(e)),A=c??(e=>V(e)*b(e)),F=y.reduce((e,t)=>e+q(t),0),Q=y.reduce((e,t)=>e+A(t),0),_=w?Math.max(F,Q):"actual"===m&&Q||F,B=_<=34.65?"20ft":"40ft",C="20ft"===B?33:67,D=_>0?Math.max(1,Math.ceil(_/C)):0,E=D*C,G=_>0&&_>=.95*E&&_<=1.1*E;if(0===y.length)return null;const H=(e,t)=>C>0?Math.max(0,Math.min((e-t*C)/C*100,100)):0;/* @__PURE__ */
|
|
2
2
|
return t("div",{className:`mt-2 px-1 space-y-2 ${x??""}`.trim(),style:f,children:[
|
|
3
3
|
/* @__PURE__ */t("div",{className:"flex items-center justify-between text-xs text-gray-500",children:[
|
|
4
|
-
/* @__PURE__ */t("span",{children:[`${p.items(y.length)} · ${p.pieces(M)}`,w&&I
|
|
5
|
-
/* @__PURE__ */a("span",{className:"w-1.5 h-1.5 rounded-full bg-green-500"}),p.added($,k)]})]}),
|
|
4
|
+
/* @__PURE__ */t("span",{children:[`${p.items(y.length)} · ${p.pieces(M)}`,w&&j!==I&&/* @__PURE__ */a("span",{className:"ml-1 text-gray-400",children:p.split(j,I)})]}),d&&$>0&&/* @__PURE__ */t("span",{className:"flex items-center gap-1 text-green-600",children:[
|
|
5
|
+
/* @__PURE__ */a("span",{className:"w-1.5 h-1.5 rounded-full bg-green-500"}),p.added($,k)]})]}),_>0?/* @__PURE__ */t("div",{className:"space-y-2",children:[Array.from({length:D}).map((e,l)=>{const n=H(F,l),s=H(Q,l),i=w,r=Math.max(n,s),c=Math.min(n,s),m=n>=s,d=i?m?"bg-blue-500":"bg-green-500":"bg-blue-500",u=i?m?"bg-green-500":"bg-blue-500":"";/* @__PURE__ */
|
|
6
6
|
return t("div",{className:"flex items-center gap-2",children:[
|
|
7
|
-
/* @__PURE__ */a("span",{className:"text-2xs text-ink-faintest w-8 shrink-0",children:
|
|
7
|
+
/* @__PURE__ */a("span",{className:"text-2xs text-ink-faintest w-8 shrink-0",children:B}),
|
|
8
8
|
/* @__PURE__ */t("div",{className:"relative flex-1 h-4 bg-gray-100 rounded-full overflow-hidden border border-gray-200",children:[
|
|
9
9
|
/* @__PURE__ */a("div",{className:`absolute inset-y-0 left-0 ${d} transition-all`,style:{width:`${r}%`}}),i&&c>0&&/* @__PURE__ */a("div",{className:`absolute inset-y-0 left-0 ${u} transition-all`,style:{width:`${c}%`}})]}),
|
|
10
|
-
/* @__PURE__ */a("span",{className:"text-2xs text-ink-faint w-16 text-right",children:i?p.fill(Math.min(
|
|
10
|
+
/* @__PURE__ */a("span",{className:"text-2xs text-ink-faint w-16 text-right",children:i?p.fill(Math.min(Q-l*C,C),C):p.fill(Math.min(F-l*C,C),C)})]},`bar-${l}`)}),
|
|
11
11
|
/* @__PURE__ */t("div",{className:"flex items-center justify-between text-xs pt-0.5",children:[
|
|
12
12
|
/* @__PURE__ */t("span",{className:"text-gray-500 inline-flex items-center gap-1",children:[p.total,w?/* @__PURE__ */t(l,{children:[
|
|
13
13
|
/* @__PURE__ */t("span",{className:"inline-flex items-center gap-1 text-blue-700",children:[
|
|
14
14
|
/* @__PURE__ */a("span",{className:"inline-block w-2 h-2 rounded-full bg-blue-500"}),p.instructed(F)]}),
|
|
15
15
|
/* @__PURE__ */a("span",{className:"text-gray-400",children:"/"}),
|
|
16
16
|
/* @__PURE__ */t("span",{className:"inline-flex items-center gap-1 text-green-700",children:[
|
|
17
|
-
/* @__PURE__ */a("span",{className:"inline-block w-2 h-2 rounded-full bg-green-500"}),p.loaded(
|
|
18
|
-
/* @__PURE__ */t("span",{className:"font-medium "+(
|
|
17
|
+
/* @__PURE__ */a("span",{className:"inline-block w-2 h-2 rounded-full bg-green-500"}),p.loaded(Q)]})]}):/* @__PURE__ */a("b",{className:"text-gray-700",children:p.volume(_)})]}),
|
|
18
|
+
/* @__PURE__ */t("span",{className:"font-medium "+(G?"text-green-600":"text-gray-500"),children:[G&&"✓ ",D," × ",B]})]})]}):/* @__PURE__ */a("div",{className:"text-xs text-gray-400",children:p.noVolume})]})}export{s as ContainerFillChart};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{MOVE_KEYS as e,MoveHint as r,moveFromKey as t}from"./chunk-
|
|
2
|
-
return d(u.Provider,{value:i,children:/* @__PURE__ */d("div",{...o,role:"list","aria-label":r?void 0:e,"aria-labelledby":r,"data-sortable-list":i,className:`flex min-w-0 flex-col ${"comfortable"===i?"gap-2":"gap-1"} ${a}`.trim(),children:t})})}function b({children:o,title:f,thumb:b,expanded:p,onToggle:h,actions:g,below:v,active:x=!1,flat:w=!1,draggable:y=!1,dragging:N=!1,drop:k,onMove:j,rowProps:D,rowRef:P,className:
|
|
1
|
+
import{MOVE_KEYS as e,MoveHint as r,moveFromKey as t}from"./chunk-2IEKMFVL.js";import{Icon as i}from"./chunk-ISVODSRP.js";import{useBrowserLayoutEffect as a}from"./chunk-D65T4H6J.js";import{createContext as o,useContext as n,useRef as l,useId as s}from"react";import{jsx as d,jsxs as c,Fragment as m}from"react/jsx-runtime";var u=o("compact");function f({"aria-label":e,"aria-labelledby":r,children:t,spacing:i="compact",className:a="",rootProps:o}){/* @__PURE__ */
|
|
2
|
+
return d(u.Provider,{value:i,children:/* @__PURE__ */d("div",{...o,role:"list","aria-label":r?void 0:e,"aria-labelledby":r,"data-sortable-list":i,className:`flex min-w-0 flex-col ${"comfortable"===i?"gap-2":"gap-1"} ${a}`.trim(),children:t})})}function b({children:o,title:f,thumb:b,expanded:p,onToggle:h,actions:g,below:v,active:x=!1,flat:w=!1,draggable:y=!1,dragging:N=!1,drop:k,onMove:j,rowProps:D,rowRef:P,className:I=""}){const B=x||!!p,K=n(u),S=l(null),$=s(),A=[D?.["aria-describedby"],j?$:void 0].filter(Boolean).join(" ")||void 0,M=D?.tabIndex;a(()=>{const e=S.current;if(!e||void 0!==M)return;const r=[...e.querySelectorAll('a[href], button, input, select, textarea, [contenteditable]:not([contenteditable="false"]), [tabindex]')].some(r=>r!==e);j&&!r?e.tabIndex=0:e.removeAttribute("tabindex")});const R="comfortable"===K?{before:"-top-[5px]",after:"-bottom-[5px]"}:{before:"-top-0.5",after:"-bottom-0.5"},T=null!=f&&/* @__PURE__ */c(m,{children:[null!=b&&/* @__PURE__ */d("span",{"aria-hidden":"true",className:"inline-flex h-6 w-6 shrink-0 overflow-hidden rounded-sm",children:b}),
|
|
3
3
|
/* @__PURE__ */d("span",{"data-list-row-name":"",className:"min-w-0 flex-1 break-words font-semibold text-(--ink-strongest)",children:f})]});/* @__PURE__ */
|
|
4
|
-
return c("div",{role:"listitem","data-list-item":"","data-drop":k,"data-open":B||void 0,className:["relative flex min-w-0 flex-col",w?"":"rounded-(--radius-card) border bg-surface transition-colors duration-(--motion-fast)",w?"":B?"border-blue-300":"border-line hover:border-gray-300"].filter(Boolean).join(" "),children:[k&&/* @__PURE__ */d("span",{"aria-hidden":"true","data-list-drop-line":"",className:`pointer-events-none absolute inset-x-2 z-10 h-0.5 rounded-full bg-blue-500 ${
|
|
5
|
-
/* @__PURE__ */c("div",{...D,ref:e=>{var r,t;
|
|
6
|
-
/* @__PURE__ */c("div",{"data-list-row-main":"",className:"flex min-h-8 min-w-0 flex-1 items-center gap-1",children:[
|
|
7
|
-
/* @__PURE__ */d(i,{name:"chevron-right","aria-hidden":"true",strokeWidth:"2",className:"h-4 w-4 shrink-0 transition-transform duration-(--motion-base) motion-reduce:transition-none "+(p?"rotate-90":"")})]}):/* @__PURE__ */d("span",{"data-list-row-title":"",className:"flex min-w-0 flex-1 items-center gap-2 py-2",children:
|
|
4
|
+
return c("div",{role:"listitem","data-list-item":"","data-drop":k,"data-open":B||void 0,className:["relative flex min-w-0 flex-col",w?"":"rounded-(--radius-card) border bg-surface transition-colors duration-(--motion-fast)",w?"":B?"border-blue-300":"border-line hover:border-gray-300"].filter(Boolean).join(" "),children:[k&&/* @__PURE__ */d("span",{"aria-hidden":"true","data-list-drop-line":"",className:`pointer-events-none absolute inset-x-2 z-10 h-0.5 rounded-full bg-blue-500 ${R[k]}`}),
|
|
5
|
+
/* @__PURE__ */c("div",{...D,ref:e=>{var r,t;S.current=e,t=e,"function"==typeof(r=P)?r(t):r&&(r.current=t)},"data-list-row":"","data-draggable":y||void 0,"aria-keyshortcuts":D?.["aria-keyshortcuts"]??(j?e:void 0),"aria-describedby":A,onKeyDown:e=>{if(D?.onKeyDown?.(e),e.defaultPrevented||!j)return;const r=t(e);r&&!e.target.closest?.("select")&&(e.preventDefault(),j(r))},className:["group/listrow relative flex min-h-8 min-w-0 items-center gap-1 rounded-md text-sm",w?"":"min-h-10 pl-3",y?"cursor-grab active:cursor-grabbing":"","rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",null!=g&&!1!==g?"":"pr-2",N?"opacity-40":"",I].filter(Boolean).join(" "),children:[
|
|
6
|
+
/* @__PURE__ */c("div",{"data-list-row-main":"",className:"flex min-h-8 min-w-0 flex-1 items-center gap-1",children:[T&&(h?/* @__PURE__ */c("button",{type:"button","aria-expanded":!!p,onClick:h,"data-list-row-title":"",className:"flex min-w-0 flex-1 items-center gap-2 self-stretch rounded-sm py-2 text-left text-(--ink-strongest) rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",children:[T,
|
|
7
|
+
/* @__PURE__ */d(i,{name:"chevron-right","aria-hidden":"true",strokeWidth:"2",className:"h-4 w-4 shrink-0 transition-transform duration-(--motion-base) motion-reduce:transition-none "+(p?"rotate-90":"")})]}):/* @__PURE__ */d("span",{"data-list-row-title":"",className:"flex min-w-0 flex-1 items-center gap-2 py-2",children:T})),o]}),null!=g&&!1!==g&&/* @__PURE__ */d("div",{"data-list-actions":"",className:"flex shrink-0 items-center gap-0.5",children:g}),j&&/* @__PURE__ */d(r,{id:$})]}),null!=v&&!1!==v&&/* @__PURE__ */d("div",{"data-list-below":"",className:w?"":"px-3 pb-3",children:v})]})}export{b as ListRow,f as SortableList};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import{
|
|
2
|
-
return g("div",{className:`relative ${
|
|
3
|
-
/* @__PURE__ */g("svg",{width:"100%",height:K,viewBox:`0 0 ${ee} ${K}`,role:"img","aria-labelledby":T,onMouseLeave:()=>
|
|
4
|
-
/* @__PURE__ */p("title",{id:T,children:
|
|
5
|
-
return p("path",{d:
|
|
1
|
+
import{MOTION as e,stagger as t}from"./chunk-465RRWBY.js";import{arcPath as l}from"./chunk-VFC6QUEN.js";import{useHighlight as a}from"./chunk-CNYAHYE6.js";import{usePlotWidth as r}from"./chunk-MAFUXCPZ.js";import{angleScale as n}from"./chunk-2JWPNR2U.js";import{ChartTooltip as o}from"./chunk-WDQI3FV6.js";import{CHART_INK as s,resolveSeriesColor as i}from"./chunk-TZFACUMR.js";import{useShellStrings as h,useShellLocale as c}from"./chunk-HCDG7EUR.js";import{formatPercent as m,formatPlain as u}from"./chunk-C3QOHMR6.js";import{useId as d,useState as f,useRef as y}from"react";import{jsx as p,jsxs as g}from"react/jsx-runtime";function x({segments:x,variant:v="pie",size:k=280,innerRadius:M,padAngle:b=.012,maxSegments:N=6,otherLabel:I,formatValue:$,centerLabel:j,animate:F=!0,labels:w="none",labelMinShare:C=.04,className:P,emptyLabel:S}){const A=h().charts,R=c(),W=$??(e=>u(e,R)),E=I??A.other,z=S??A.nothingToBreakDown,T=d(),[U,V]=f(null),{highlighted:_}=a(),L=y(null),Y=r(L,Number.POSITIVE_INFINITY),B=x.map((e,t)=>({...e,slot:t})).filter(e=>e.value>0);if(0===B.length)/* @__PURE__ */return p("p",{className:`text-sm text-gray-500 ${P??""}`,children:z});const D=[...B].sort((e,t)=>t.value-e.value),H=D.slice(0,N),O=D.slice(N),Q=O.length>0?[...H,{key:"__other__",label:E,value:O.reduce((e,t)=>e+t.value,0),slot:-1,color:s.muted}]:H,Z=e=>i(e.slot,e.color,e.tone),q=Q.reduce((e,t)=>e+t.value,0),G=Math.ceil(.62*Math.max(...Q.map(e=>String(e.label).length),4)*11)+24,J="outside"===w&&Y>=120+2*G,X=J?G:0,K=J?Math.max(120,Math.min(k,Y-2*X)):k,ee=K+2*X,te=X+K/2,le=K/2,ae=K/2-12,re=M??("ring"===v?.58*ae:0),ne=n(Q.length,b),oe=Math.max(...Q.map(e=>e.value)),se=e=>re+(ae-re)*Math.sqrt(Math.max(0,e)/oe);let ie=-Math.PI/2;const he=(()=>{if(!J)return[];let e=-Math.PI/2;const t=Q.map((t,l)=>{const a="rose"===v?n(Q.length,b).step:t.value/q*Math.PI*2,r="rose"===v?n(Q.length,b).center(l):e+a/2;e+=a;const o="rose"===v?se(t.value):ae;return{key:t.key,label:t.label,share:t.value/q,right:Math.cos(r)>=0,anchor:[te+o*Math.cos(r),le+o*Math.sin(r)],y:le+(o+14)*Math.sin(r),index:l}}).filter(e=>e.share>=C),l=Math.max(1,Math.floor((K-11-13)/26)+1),a=/* @__PURE__ */new Set;for(const e of[!0,!1]){const r=t.filter(t=>t.right===e).sort((e,t)=>t.share-e.share).slice(0,l).sort((e,t)=>e.y-t.y);for(let e=1;e<r.length;e+=1)r[e].y-r[e-1].y<26&&(r[e].y=r[e-1].y+26);for(let e=r.length-1;e>=0;e-=1){const t=e===r.length-1?K-13:r[e+1].y-26;r[e].y=Math.min(r[e].y,t)}r.forEach((e,t)=>{e.y=Math.max(e.y,0===t?11:r[t-1].y+26),a.add(e.key)})}return t.filter(e=>a.has(e.key))})(),ce=(e,t)=>null!==U?U!==e:null!==_&&_!==t,me=null!==U?Q[U]:void 0;/* @__PURE__ */
|
|
2
|
+
return g("div",{className:`relative ${P??""}`,ref:L,children:[
|
|
3
|
+
/* @__PURE__ */g("svg",{width:"100%",height:K,viewBox:`0 0 ${ee} ${K}`,role:"img","aria-labelledby":T,onMouseLeave:()=>V(null),children:[
|
|
4
|
+
/* @__PURE__ */p("title",{id:T,children:A.breakdown(W(q),Q.length)}),Q.map((a,r)=>{const n=Z(a),o="rose"===v?ne(r):ie,i="rose"===v?ne.step:a.value/q*Math.PI*2-b;"rose"!==v&&(ie+=a.value/q*Math.PI*2);const h=o+Math.max(.001,i),c="rose"===v?se(a.value):ae;/* @__PURE__ */
|
|
5
|
+
return p("path",{d:l(te,le,re,c,o,h),fill:n,fillOpacity:ce(r,a.key)?.4:1,stroke:s.surface,strokeWidth:1,className:F?e.sweep:void 0,style:F?t(r,55):void 0,onMouseEnter:()=>V(r)},a.key)}),he.map(e=>{const t=e.right?ee-6:6,l=e.right?te+ae+14:te-ae-14;/* @__PURE__ */
|
|
6
6
|
return g("g",{children:[
|
|
7
7
|
/* @__PURE__ */p("polyline",{points:`${e.anchor[0].toFixed(1)},${e.anchor[1].toFixed(1)} ${l},${e.y.toFixed(1)} ${t},${e.y.toFixed(1)}`,fill:"none",stroke:s.grid,strokeWidth:1}),
|
|
8
8
|
/* @__PURE__ */p("text",{x:t,y:e.y-2,fontSize:11,fill:s.label,textAnchor:e.right?"end":"start",children:e.label}),
|
|
9
|
-
/* @__PURE__ */p("text",{x:t,y:e.y+10,fontSize:11,fontWeight:600,fill:s.label,textAnchor:e.right?"end":"start",style:{fontVariantNumeric:"tabular-nums"},children:m(100*e.share,1,
|
|
9
|
+
/* @__PURE__ */p("text",{x:t,y:e.y+10,fontSize:11,fontWeight:600,fill:s.label,textAnchor:e.right?"end":"start",style:{fontVariantNumeric:"tabular-nums"},children:m(100*e.share,1,R)})]},`lbl-${e.key}`)}),j&&re>0&&/* @__PURE__ */p("text",{x:te,y:le+5,textAnchor:"middle",fontSize:16,fontWeight:600,fill:s.label,children:j})]}),me&&null!==U&&/* @__PURE__ */p("div",{className:"pointer-events-none absolute top-2 left-2 z-10",children:/* @__PURE__ */p(o,{title:me.label,rows:[{key:"value",label:A.value,color:Z(me),value:W(me.value)},{key:"share",label:A.share,color:s.muted,value:m(me.value/q*100,1,R)}]})}),
|
|
10
10
|
/* @__PURE__ */p("ul",{className:"m-0 mt-3 grid gap-1 p-0",style:{gridTemplateColumns:"repeat(auto-fit,minmax(140px,1fr))"},children:Q.map((e,t)=>/* @__PURE__ */g("li",{className:"flex list-none items-center gap-2 text-xs text-gray-600",children:[
|
|
11
|
-
/* @__PURE__ */p("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:
|
|
11
|
+
/* @__PURE__ */p("span",{className:"h-2.5 w-2.5 shrink-0 rounded-sm",style:{backgroundColor:Z(e)}}),
|
|
12
12
|
/* @__PURE__ */p("span",{className:"flex-1 truncate",children:e.label}),
|
|
13
|
-
/* @__PURE__ */p("span",{className:"tabular-nums text-gray-800",children:m(e.value/
|
|
13
|
+
/* @__PURE__ */p("span",{className:"tabular-nums text-gray-800",children:m(e.value/q*100,1,R)})]},e.key))})]})}export{x as PieChart};
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import{Icon as e}from"./chunk-
|
|
2
|
-
/* @__PURE__ */u("div",{className:"flex shrink-0 flex-wrap items-center gap-1 border-b border-gray-200 bg-gray-50 px-3 py-2 text-xs",children:e})}"undefined"==typeof window||c.GlobalWorkerOptions.workerSrc||(c.GlobalWorkerOptions.workerSrc=`https://unpkg.com/pdfjs-dist@${c.version}/build/pdf.worker.min.mjs`);var g={"jbig2.wasm":new URL("pdfjs-dist/wasm/jbig2.wasm",import.meta.url).href,"openjpeg.wasm":new URL("pdfjs-dist/wasm/openjpeg.wasm",import.meta.url).href},w=class{async fetch({kind:e,filename:t}){if("wasmUrl"!==e)throw new Error(`Ensure that the \`${e}\` API parameter is provided.`);const n=g[t];if(!n)throw new Error(`No bundled pdf.js wasm module for "${t}".`);const r=await fetch(n);if(!r.ok)throw new Error(`Unable to load wasm data at: ${n}`);const a=new Uint8Array(await r.arrayBuffer());if(!function(e){return e.length>=4&&0===e[0]&&97===e[1]&&115===e[2]&&109===e[3]}(a))throw h(n,t,a);return a}};function y(e){const t=e||("undefined"!=typeof window?window.__REACT_OS_SHELL_PDF_WASM__:void 0);return"string"==typeof t&&t?{wasmUrl:t.endsWith("/")?t:`${t}/`}:{BinaryDataFactory:w}}var v=[50,75,100,125,150,200,300,400];function b(e,t,n){const r=(t.width-40)/n.width,a="page"===e?Math.min(r,(t.height-40)/n.height):r;return Math.min(Math.max(a,.3),4)}function x({url:a,filename:o,fit:d="width",onDownload:h,onEmail:p,workerSrc:g,wasmUrl:w}){const x=r().pdf,k=i(null),C=i(null),N=i(null),[
|
|
1
|
+
import{Icon as e}from"./chunk-ISVODSRP.js";import{LoadingSpinner as t}from"./chunk-R2VKEMZH.js";import{toast_default as n}from"./chunk-5X3Z45SL.js";import{useShellStrings as r}from"./chunk-HCDG7EUR.js";import{createContext as a,useContext as o,useRef as i,useState as s,useEffect as l}from"react";import*as c from"pdfjs-dist";import{createPortal as d}from"react-dom";import{jsx as u,jsxs as m}from"react/jsx-runtime";function h(e,t,n){return new Error(`The response for ${e} is not a WebAssembly module (got ${function(e){if(0===e.length)return"an empty response";const t=Array.from(e.subarray(0,24)).map(e=>e>=32&&e<127?String.fromCharCode(e):".").join("");return`${e.length} bytes starting "${t}"`}(n)}). The bundler did not emit "${t}" as an asset, and the host answered with a fallback page instead of a 404. Serve pdfjs-dist/wasm/ yourself and point window.__REACT_OS_SHELL_PDF_WASM__ at it.`)}var p=a(null);function f({children:e}){const t=o(p);return t?d(e,t):
|
|
2
|
+
/* @__PURE__ */u("div",{className:"flex shrink-0 flex-wrap items-center gap-1 border-b border-gray-200 bg-gray-50 px-3 py-2 text-xs",children:e})}"undefined"==typeof window||c.GlobalWorkerOptions.workerSrc||(c.GlobalWorkerOptions.workerSrc=`https://unpkg.com/pdfjs-dist@${c.version}/build/pdf.worker.min.mjs`);var g={"jbig2.wasm":new URL("pdfjs-dist/wasm/jbig2.wasm",import.meta.url).href,"openjpeg.wasm":new URL("pdfjs-dist/wasm/openjpeg.wasm",import.meta.url).href},w=class{async fetch({kind:e,filename:t}){if("wasmUrl"!==e)throw new Error(`Ensure that the \`${e}\` API parameter is provided.`);const n=g[t];if(!n)throw new Error(`No bundled pdf.js wasm module for "${t}".`);const r=await fetch(n);if(!r.ok)throw new Error(`Unable to load wasm data at: ${n}`);const a=new Uint8Array(await r.arrayBuffer());if(!function(e){return e.length>=4&&0===e[0]&&97===e[1]&&115===e[2]&&109===e[3]}(a))throw h(n,t,a);return a}};function y(e){const t=e||("undefined"!=typeof window?window.__REACT_OS_SHELL_PDF_WASM__:void 0);return"string"==typeof t&&t?{wasmUrl:t.endsWith("/")?t:`${t}/`}:{BinaryDataFactory:w}}var v=[50,75,100,125,150,200,300,400];function b(e,t,n){const r=(t.width-40)/n.width,a="page"===e?Math.min(r,(t.height-40)/n.height):r;return Math.min(Math.max(a,.3),4)}function x({url:a,filename:o,fit:d="width",onDownload:h,onEmail:p,workerSrc:g,wasmUrl:w}){const x=r().pdf,k=i(null),C=i(null),N=i(null),[j,E]=s(null),[M,z]=s(1),[D,P]=s(0),[S,_]=s(1),[L,W]=s(!0),[$,O]=s(!0),T=i(x.loadFailed);T.current=x.loadFailed,l(()=>{let e=!1;return O(!0),z(1),g&&(c.GlobalWorkerOptions.workerSrc=g),c.getDocument({url:a,...y(w)}).promise.then(t=>{e||(E(t),P(t.numPages),O(!1))}).catch(()=>{e||(n.error(T.current),O(!1))}),()=>{e=!0}},[a,g,w]),l(()=>{if(!j||!L||!N.current)return;const e=()=>{const e=N.current;e&&j.getPage(M).then(t=>{if(!N.current)return;const n=t.getViewport({scale:1}),r=b(d,{width:e.clientWidth,height:e.clientHeight},{width:n.width,height:n.height});_(e=>Math.abs(e-r)<.005?e:r)})};e();const t=new ResizeObserver(e);return t.observe(N.current),()=>t.disconnect()},[j,M,L,d]),l(()=>{if(!j||!k.current)return;let e=!1,t=null,n=null;return j.getPage(M).then(r=>{if(e||!k.current)return;const a=r.getViewport({scale:S}),o=k.current;o.width=a.width,o.height=a.height,o.style.width=`${a.width}px`,o.style.height=`${a.height}px`;const i=o.getContext("2d");t=r.render({canvas:o,canvasContext:i,viewport:a}),t.promise.catch(()=>{});const s=C.current;s&&(s.replaceChildren(),s.style.setProperty("--total-scale-factor",String(a.scale)),n=new c.TextLayer({textContentSource:r.streamTextContent(),container:s,viewport:a}),n.render().then(()=>{if(e)return;const t=document.createElement("div");t.className="endOfContent",s.append(t)}).catch(()=>{}))}),()=>{e=!0,t?.cancel(),n?.cancel()}},[j,M,S]),l(()=>{const e=()=>C.current?.classList.remove("selecting");return window.addEventListener("pointerup",e),()=>window.removeEventListener("pointerup",e)},[]);const A="page"===d?x.fitPage:x.fitWidth,H="px-2 py-1 rounded hover:bg-gray-200 transition-colors text-gray-600 flex items-center gap-1";/* @__PURE__ */
|
|
3
3
|
return m("div",{className:"flex flex-col h-full",children:[
|
|
4
4
|
/* @__PURE__ */m(f,{children:[
|
|
5
|
-
/* @__PURE__ */u("button",{type:"button","aria-label":x.previousPage,onClick:()=>z(e=>Math.max(1,e-1)),disabled:
|
|
6
|
-
/* @__PURE__ */u("span",{className:"text-gray-600 font-medium tabular-nums whitespace-nowrap",children:x.pageOf(
|
|
7
|
-
/* @__PURE__ */u("button",{type:"button","aria-label":x.nextPage,onClick:()=>z(e=>Math.min(
|
|
5
|
+
/* @__PURE__ */u("button",{type:"button","aria-label":x.previousPage,onClick:()=>z(e=>Math.max(1,e-1)),disabled:M<=1,className:"px-1 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-600",children:/* @__PURE__ */u(e,{name:"chevron-left",className:"h-3.5 w-3.5",strokeWidth:2})}),
|
|
6
|
+
/* @__PURE__ */u("span",{className:"text-gray-600 font-medium tabular-nums whitespace-nowrap",children:x.pageOf(M,D)}),
|
|
7
|
+
/* @__PURE__ */u("button",{type:"button","aria-label":x.nextPage,onClick:()=>z(e=>Math.min(D,e+1)),disabled:M>=D,className:"px-1 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-600",children:/* @__PURE__ */u(e,{name:"chevron-right",className:"h-3.5 w-3.5",strokeWidth:2})}),
|
|
8
8
|
/* @__PURE__ */u("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
|
|
9
|
-
/* @__PURE__ */u("button",{type:"button","aria-label":x.zoomOut,title:x.zoomOut,onClick:()=>{
|
|
10
|
-
/* @__PURE__ */m("select",{value:
|
|
11
|
-
/* @__PURE__ */u("option",{value:"fit",children:
|
|
12
|
-
/* @__PURE__ */u("button",{type:"button","aria-label":x.zoomIn,title:x.zoomIn,onClick:()=>{
|
|
13
|
-
/* @__PURE__ */u("button",{type:"button",onClick:()=>
|
|
9
|
+
/* @__PURE__ */u("button",{type:"button","aria-label":x.zoomOut,title:x.zoomOut,onClick:()=>{W(!1),_(e=>Math.max(.3,Math.round(100*(e-.25))/100))},className:H,children:/* @__PURE__ */u("span",{"aria-hidden":"true",children:"−"})}),
|
|
10
|
+
/* @__PURE__ */m("select",{value:L?"fit":v.includes(Math.round(100*S))?Math.round(100*S):"custom",onChange:e=>{const t=e.target.value;"fit"!==t?"custom"!==t&&(W(!1),_(Number(t)/100)):W(!0)},className:"bg-transparent hover:bg-gray-200 rounded px-1 py-1 text-gray-600 tabular-nums cursor-pointer focus:outline-none focus:ring-1 focus:ring-blue-400","aria-label":x.zoom,title:x.zoom,children:[
|
|
11
|
+
/* @__PURE__ */u("option",{value:"fit",children:A}),!L&&!v.includes(Math.round(100*S))&&/* @__PURE__ */m("option",{value:"custom",children:[Math.round(100*S),"%"]}),v.map(e=>/* @__PURE__ */m("option",{value:e,children:[e,"%"]},e))]}),
|
|
12
|
+
/* @__PURE__ */u("button",{type:"button","aria-label":x.zoomIn,title:x.zoomIn,onClick:()=>{W(!1),_(e=>Math.min(4,Math.round(100*(e+.25))/100))},className:H,children:/* @__PURE__ */u("span",{"aria-hidden":"true",children:"+"})}),
|
|
13
|
+
/* @__PURE__ */u("button",{type:"button",onClick:()=>W(!0),"aria-pressed":L,className:H+(L?" bg-gray-200 text-gray-900":""),title:x.fitHint,children:x.fit}),
|
|
14
14
|
/* @__PURE__ */u("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
|
|
15
|
-
/* @__PURE__ */m("button",{type:"button",onClick:()=>{if(!
|
|
15
|
+
/* @__PURE__ */m("button",{type:"button",onClick:()=>{if(!j)return;const e=window.open("","_blank");if(!e)return void n.error(x.allowPopups);const t=[];for(let e=1;e<=D;e++)t.push(j.getPage(e).then(e=>{const t=e.getViewport({scale:2}),n=document.createElement("canvas");return n.width=t.width,n.height=t.height,e.render({canvas:n,canvasContext:n.getContext("2d"),viewport:t}).promise.then(()=>n.toDataURL())}));Promise.all(t).then(t=>{var n;e.document.write(`<html><head><title>${n=o,n.replace(/[&<>"]/g,e=>({"&":"&","<":"<",">":">",'"':"""}[e]))}</title><style>@media print{body{margin:0}img{width:100%;page-break-after:always}}</style></head><body>`),e.document.write(t.map(e=>`<img src="${e}"/>`).join("")),e.document.write("</body></html>"),e.document.close(),setTimeout(()=>{e.print(),e.close()},300)})},className:H,children:[
|
|
16
16
|
/* @__PURE__ */u(e,{name:"print",className:"h-3.5 w-3.5",strokeWidth:1.5}),x.print]}),
|
|
17
17
|
/* @__PURE__ */m("button",{type:"button",onClick:h??(()=>{const e=document.createElement("a");e.href=a,e.download=o,e.click()}),className:H,children:[
|
|
18
18
|
/* @__PURE__ */u(e,{name:"download",className:"h-3.5 w-3.5",strokeWidth:1.5}),x.download]}),p&&/* @__PURE__ */m("button",{type:"button",onClick:p,className:H,children:[
|
|
19
19
|
/* @__PURE__ */u(e,{name:"email",className:"h-3.5 w-3.5",strokeWidth:1.5}),x.email]})]}),
|
|
20
|
-
/* @__PURE__ */u("div",{ref:N,className:"flex-1 overflow-auto bg-gray-100 outline-none",tabIndex:0,onWheel:e=>{if(!
|
|
20
|
+
/* @__PURE__ */u("div",{ref:N,className:"flex-1 overflow-auto bg-gray-100 outline-none",tabIndex:0,onWheel:e=>{if(!j)return;if(e.ctrlKey||e.metaKey)return;const t=N.current;if(!t)return;const n=t.scrollTop<=0,r=t.scrollTop+t.clientHeight>=t.scrollHeight-1;e.deltaY>0&&r&&M<D?(e.preventDefault(),z(e=>Math.min(D,e+1)),requestAnimationFrame(()=>{N.current&&(N.current.scrollTop=0)})):e.deltaY<0&&n&&M>1&&(e.preventDefault(),z(e=>Math.max(1,e-1)),requestAnimationFrame(()=>{N.current&&(N.current.scrollTop=N.current.scrollHeight)}))},onKeyDown:e=>{if(!j)return;const t=(document.activeElement?.tagName||"").toLowerCase();"input"===t||"textarea"===t||document.activeElement?.isContentEditable||("PageDown"===e.key||"ArrowRight"===e.key?M<D&&(e.preventDefault(),z(e=>Math.min(D,e+1))):"PageUp"===e.key||"ArrowLeft"===e.key?M>1&&(e.preventDefault(),z(e=>Math.max(1,e-1))):"Home"===e.key?(e.preventDefault(),z(1)):"End"===e.key&&(e.preventDefault(),z(D)))},children:$?/* @__PURE__ */u(t,{size:"sm",padding:"",className:"h-full",label:x.loading}):/* @__PURE__ */m("div",{className:"min-h-full flex items-center justify-center p-4",children:[
|
|
21
21
|
/* @__PURE__ */u("style",{children:'\n.preview-pdf-textlayer {\n position: absolute;\n inset: 0;\n overflow: clip;\n line-height: 1;\n text-align: initial;\n text-size-adjust: none;\n forced-color-adjust: none;\n transform-origin: 0 0;\n caret-color: CanvasText;\n --min-font-size: 1;\n --text-scale-factor: calc(var(--total-scale-factor, 1) * var(--min-font-size));\n --min-font-size-inv: calc(1 / var(--min-font-size));\n}\n.preview-pdf-textlayer :is(span, br) {\n color: transparent;\n position: absolute;\n white-space: pre;\n cursor: text;\n transform-origin: 0% 0%;\n}\n.preview-pdf-textlayer > :not(.markedContent),\n.preview-pdf-textlayer .markedContent span:not(.markedContent) {\n z-index: 1;\n --font-height: 0;\n font-size: calc(var(--text-scale-factor) * var(--font-height));\n --scale-x: 1;\n --rotate: 0deg;\n transform: rotate(var(--rotate)) scaleX(var(--scale-x)) scale(var(--min-font-size-inv));\n}\n.preview-pdf-textlayer .markedContent {\n display: contents;\n}\n.preview-pdf-textlayer span[role="img"] {\n user-select: none;\n cursor: default;\n}\n.preview-pdf-textlayer ::selection {\n background: rgba(0, 80, 255, 0.25);\n}\n.preview-pdf-textlayer br::selection {\n background: transparent;\n}\n.preview-pdf-textlayer .endOfContent {\n display: block;\n position: absolute;\n inset: 100% 0 0;\n z-index: 0;\n cursor: default;\n user-select: none;\n}\n.preview-pdf-textlayer.selecting .endOfContent {\n top: 0;\n}\n'}),
|
|
22
22
|
/* @__PURE__ */m("div",{className:"relative shadow-lg rounded",children:[
|
|
23
23
|
/* @__PURE__ */u("canvas",{ref:k,className:"block rounded"}),
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{ColoredBadge as e}from"./chunk-
|
|
1
|
+
import{ColoredBadge as e}from"./chunk-SAAXAAAH.js";import{Button_default as n}from"./chunk-EVYD6UFQ.js";import{useShellStrings as i}from"./chunk-HCDG7EUR.js";import{useId as t}from"react";import{jsx as m,jsxs as a}from"react/jsx-runtime";function s({items:s,heading:l,emptyText:r,className:c=""}){const o=i().media,d=t();return s.length?/* @__PURE__ */a("div",{className:c||void 0,children:[
|
|
2
2
|
/* @__PURE__ */m("p",{id:d,className:"text-xs font-medium text-ink-faint",children:l??o.usedIn(s.length)}),
|
|
3
3
|
/* @__PURE__ */m("ul",{"aria-labelledby":d,className:"mt-2 flex flex-col gap-1",children:s.map(i=>/* @__PURE__ */a("li",{className:"flex min-w-0 items-center gap-2 text-sm",children:[null!=i.kind&&/* @__PURE__ */m(e,{size:"xs",className:"flex-none",children:i.kind}),i.onOpen?/* @__PURE__ */m(n,{variant:"link",size:"sm",onClick:i.onOpen,className:"min-w-0 text-left",children:i.name}):/* @__PURE__ */m("span",{className:"min-w-0 break-words text-ink",children:i.name})]},i.key))})]}):/* @__PURE__ */m("p",{className:`text-sm text-ink-faint ${c}`.trim(),children:r??o.notUsed})}export{s as MediaUsedInList};
|