efficient-shell 11.8.0 → 11.11.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 +12 -1
- package/dist/{Browser-NMILHEUX.js → Browser-NRGJ53ST.js} +14 -14
- package/dist/{Calculator-E7AMPGD5.js → Calculator-YZEGVEQ7.js} +22 -22
- package/dist/{CurrencyConverter-TAWZDMT4.js → CurrencyConverter-CJQMDBQW.js} +6 -6
- package/dist/Documents-FIGKS36O.js +84 -0
- package/dist/{Files-YQWVU6KZ.js → Files-FPNJ46XY.js} +88 -88
- package/dist/{Notepad-DZSDABU7.js → Notepad-2XW63REV.js} +9 -9
- package/dist/PdfViewer-M4RTCNNE.js +1 -0
- package/dist/{PomodoroTimer-RAZE37BO.js → PomodoroTimer-Y5GQX37J.js} +21 -21
- package/dist/{Preview-6Z6K5QLK.js → Preview-K7KDM4XK.js} +24 -24
- package/dist/Sidebar-QP5Y7RBV.js +44 -0
- package/dist/Spreadsheet-RQE4OCEK.js +75 -0
- package/dist/{Stock-HJN2BSAD.js → Stock-IHAG62QV.js} +3 -3
- package/dist/{Weather-G7AOUS36.js → Weather-EQDFEBIH.js} +19 -19
- package/dist/{WorldClock-GE3DGYYU.js → WorldClock-VQG7G2Z2.js} +6 -6
- package/dist/ai/index.js +78 -78
- package/dist/apps/index.js +1 -1
- package/dist/bin/media-host-check.js +1 -1
- package/dist/bin/ui-check.js +1 -1
- package/dist/brand.css +1 -1
- package/dist/charts/BoxPlotChart.js +1 -1
- package/dist/charts/CandlestickChart.js +1 -1
- package/dist/charts/CartesianPlot.js +1 -1
- package/dist/charts/ChartBrush.js +1 -1
- package/dist/charts/ChartFrame.js +1 -1
- package/dist/charts/ChartSkeleton.js +1 -1
- package/dist/charts/ChordChart.js +1 -1
- package/dist/charts/ColumnChart.js +1 -1
- package/dist/charts/FunnelChart.js +1 -1
- package/dist/charts/HeatmapChart.js +1 -1
- package/dist/charts/HistogramChart.js +1 -1
- package/dist/charts/Meter.js +1 -1
- package/dist/charts/PieChart.js +1 -1
- package/dist/charts/RadarChart.js +1 -1
- package/dist/charts/RadialBarChart.js +1 -1
- package/dist/charts/RangeChart.js +1 -1
- package/dist/charts/RankedBars.js +1 -1
- package/dist/charts/SankeyChart.js +1 -1
- package/dist/charts/ScatterChart.js +1 -1
- package/dist/charts/SpecChart.js +1 -1
- package/dist/charts/StatTile.js +1 -1
- package/dist/charts/SunburstChart.js +1 -1
- package/dist/charts/TimeSeriesChart.js +1 -1
- package/dist/charts/TreemapChart.js +1 -1
- package/dist/charts/WaterfallChart.js +1 -1
- package/dist/{chunk-LXL2UCUR.js → chunk-225LCPO7.js} +1 -1
- package/dist/{chunk-JFBL4PR3.js → chunk-2E3K4FSQ.js} +1 -1
- package/dist/chunk-2EPAXWZZ.js +14 -0
- package/dist/{chunk-N7U622NC.js → chunk-2HAJ33HM.js} +2 -2
- package/dist/{chunk-V6Y4OC6K.js → chunk-2NRNKF46.js} +8 -8
- package/dist/chunk-2XOH3NJZ.js +27 -0
- package/dist/{chunk-4EZIWLJJ.js → chunk-2XORVHF2.js} +1 -1
- package/dist/{chunk-OBJGUJIE.js → chunk-2ZAFRGRF.js} +1 -1
- package/dist/{chunk-RYLTVHCV.js → chunk-32EKHIAZ.js} +11 -11
- package/dist/{chunk-RHDM7HRD.js → chunk-3JCOD5L2.js} +2 -2
- package/dist/{chunk-X5TZHOTI.js → chunk-3OHADZYV.js} +1 -1
- package/dist/{chunk-O3MBPAWZ.js → chunk-3PZI2C4R.js} +1 -1
- package/dist/chunk-3VR5BOD4.js +8 -0
- package/dist/{chunk-3XTSXZAC.js → chunk-3X2W7R5B.js} +10 -10
- package/dist/{chunk-G3KXB7SP.js → chunk-3ZRYKZGI.js} +9 -9
- package/dist/{chunk-KTCM64DQ.js → chunk-42TLGG33.js} +1 -1
- package/dist/{chunk-SS5SQMIB.js → chunk-57WQVUBX.js} +2 -2
- package/dist/{chunk-3V5GSTZI.js → chunk-5B4GRLAA.js} +1 -1
- package/dist/{chunk-3IUPYCW3.js → chunk-5KKJAYKT.js} +1 -1
- package/dist/{chunk-UEISJFZH.js → chunk-5UCRYSQJ.js} +5 -5
- package/dist/chunk-5YP7MFPK.js +1 -0
- package/dist/{chunk-KGSOOXA7.js → chunk-62BDGAML.js} +4 -4
- package/dist/{chunk-CD7UWMPX.js → chunk-63545Z3N.js} +1 -1
- package/dist/{chunk-TGGUYAWA.js → chunk-6C6M3QXL.js} +1 -1
- package/dist/{chunk-VHF3CJVO.js → chunk-6CK44QWU.js} +28 -28
- package/dist/{chunk-5F2AIDPY.js → chunk-6DQANKTL.js} +8 -8
- package/dist/chunk-6FIYG7IH.js +28 -0
- package/dist/{chunk-SHO35OPO.js → chunk-6LITLCVV.js} +1 -1
- package/dist/{chunk-RRE2NNFS.js → chunk-6LK2BBCC.js} +5 -5
- package/dist/chunk-6R32KKIS.js +22 -0
- package/dist/{chunk-IXOL7Y3Z.js → chunk-7HLBVMMQ.js} +1 -1
- package/dist/{chunk-M4BPHBKI.js → chunk-7IVTGOGM.js} +1 -1
- package/dist/{chunk-47DO42IW.js → chunk-7R23EKON.js} +1 -1
- package/dist/{chunk-2UO47XB4.js → chunk-7V32O5NF.js} +30 -14
- package/dist/{chunk-YCWALB3A.js → chunk-A4YTWDKD.js} +1 -1
- package/dist/{chunk-PVPMJ5G2.js → chunk-AHITTM6W.js} +1 -1
- package/dist/{chunk-UGBYAVJV.js → chunk-ALJS3SYS.js} +1 -1
- package/dist/{chunk-ZXVJL7MS.js → chunk-AQGIK2CV.js} +1 -1
- package/dist/{chunk-FT3QRQWY.js → chunk-ATKFIHDP.js} +4 -4
- package/dist/{chunk-AWKJZSTO.js → chunk-AWQ5SOC5.js} +1 -1
- package/dist/{chunk-77AQNJE2.js → chunk-B2AYI45X.js} +8 -8
- package/dist/{chunk-PFKXPSOM.js → chunk-B2MD232O.js} +5 -5
- package/dist/{chunk-6EIZOX6W.js → chunk-B2SLXCMY.js} +8 -8
- package/dist/{chunk-F3ZFCQGP.js → chunk-BDUXF7BT.js} +3 -3
- package/dist/{chunk-DGNAUGZ3.js → chunk-C3UY34DC.js} +2 -2
- package/dist/{chunk-MDYJVXWD.js → chunk-CAIKDX2M.js} +2 -2
- package/dist/{chunk-FA5FBNWF.js → chunk-CDQUOCXO.js} +1 -1
- package/dist/{chunk-DJW7CM3W.js → chunk-CG5X5ZLV.js} +1 -1
- package/dist/{chunk-IDI3IOY4.js → chunk-CLAKVFOB.js} +67 -67
- package/dist/{chunk-VQBEZNHC.js → chunk-CSLMWGFS.js} +1 -1
- package/dist/{chunk-BW47XJLH.js → chunk-CT7AU2TA.js} +1 -1
- package/dist/{chunk-4ULRP4Y4.js → chunk-D4RVWSUT.js} +1 -1
- package/dist/{chunk-EOWUUOVE.js → chunk-DHMOJX2Z.js} +1 -1
- package/dist/{chunk-VAPSWR5Q.js → chunk-E3EHHR73.js} +9 -9
- package/dist/chunk-EC22ACQZ.js +11 -0
- package/dist/{chunk-M3JNILT2.js → chunk-ESWR7YNY.js} +15 -15
- package/dist/{chunk-MDV7UQJD.js → chunk-EV7VAXMO.js} +8 -8
- package/dist/{chunk-GELPD7EY.js → chunk-F636NDAU.js} +8 -8
- package/dist/{chunk-4TYIYL56.js → chunk-FFNPAJLS.js} +10 -10
- package/dist/{chunk-WMHZA4EO.js → chunk-FJBJUFD7.js} +3 -3
- package/dist/{chunk-JSG2AKCG.js → chunk-FRH2AHPI.js} +1 -1
- package/dist/{chunk-5H4SWQGM.js → chunk-FUHURDBL.js} +1 -1
- package/dist/chunk-GO6HU2O3.js +7 -0
- package/dist/{chunk-DQQKG46I.js → chunk-GRC46C4V.js} +7 -7
- package/dist/chunk-H56TNUV4.js +1 -0
- package/dist/{chunk-SDDV3UCN.js → chunk-HDABS36W.js} +16 -16
- package/dist/{chunk-LJN77RG6.js → chunk-HJBR73GS.js} +1 -1
- package/dist/{chunk-DU4WEVNS.js → chunk-HRG4FYVU.js} +1 -1
- package/dist/{chunk-4MBYFQOI.js → chunk-I5XNADZ3.js} +4 -4
- package/dist/chunk-IEOCUEJK.js +14 -0
- package/dist/{chunk-YDMXW2Q4.js → chunk-IGQZANYE.js} +11 -11
- package/dist/{chunk-ZGOHRLXG.js → chunk-IIKPM3F4.js} +1 -1
- package/dist/{chunk-XYECIBVX.js → chunk-IUG4Z2ND.js} +1 -1
- package/dist/{chunk-4XNVIKZZ.js → chunk-IUMFOSFJ.js} +1 -1
- package/dist/{chunk-EKCQ7XBZ.js → chunk-JG26ICX6.js} +2 -2
- package/dist/{chunk-TMMNCXQT.js → chunk-JJZAYAVL.js} +1 -1
- package/dist/{chunk-E6GDAV5R.js → chunk-JRCFOZEU.js} +4 -4
- package/dist/chunk-K6D7OSKZ.js +20 -0
- package/dist/{chunk-LT6PG6UW.js → chunk-K6LW2QLI.js} +1 -1
- package/dist/{chunk-MXGDFO6A.js → chunk-KKJ55GUZ.js} +1 -1
- package/dist/chunk-KU4IWX6F.js +2 -0
- package/dist/{chunk-7ELJQL7J.js → chunk-KVVZLEUG.js} +1 -1
- package/dist/{chunk-54NMFQMW.js → chunk-KYHDDVTR.js} +4 -4
- package/dist/{chunk-MTIP5DH2.js → chunk-KZEIQO3V.js} +3 -3
- package/dist/{chunk-NGLU2GKE.js → chunk-LGTYPLJM.js} +4 -4
- package/dist/{chunk-DUGYWX2R.js → chunk-LXOX5FGH.js} +1 -1
- package/dist/{chunk-OH5L6HYW.js → chunk-LXQHTY3A.js} +3 -3
- package/dist/{chunk-T7PVHIXI.js → chunk-M57KX3OM.js} +1 -1
- package/dist/chunk-MQ445O4X.js +6 -0
- package/dist/{chunk-4TGZODSH.js → chunk-MQE2FBJU.js} +5 -5
- package/dist/{chunk-SAP4YI2Y.js → chunk-NMQGAP3H.js} +1 -1
- package/dist/{chunk-HCXIXV4E.js → chunk-NMTS2L2B.js} +7 -7
- package/dist/{chunk-VAK5FQXH.js → chunk-NTUZT37J.js} +1 -1
- package/dist/{chunk-ORIXCEKO.js → chunk-O6VIHWYU.js} +1 -1
- package/dist/chunk-ODQYWMDF.js +3 -0
- package/dist/{chunk-2E2SUEEE.js → chunk-OLJUPBY4.js} +1 -1
- package/dist/chunk-OPZXVXX5.js +7 -0
- package/dist/{chunk-LJAYUDN2.js → chunk-OXCFRH33.js} +1 -1
- package/dist/chunk-OZM6DE7A.js +8 -0
- package/dist/{chunk-SL77N7VT.js → chunk-PDFV3YQB.js} +3 -3
- package/dist/{chunk-P4VKU3SL.js → chunk-PDXOGPWH.js} +1 -1
- package/dist/{chunk-YQFGRYEF.js → chunk-PETBAYS5.js} +11 -11
- package/dist/{chunk-IMDGMUE3.js → chunk-PL4HKGYP.js} +1 -1
- package/dist/chunk-PMA6DZ4Q.js +6 -0
- package/dist/{chunk-QYL26AB4.js → chunk-PMKBWDXO.js} +1 -1
- package/dist/{chunk-B634WHJ2.js → chunk-PVOTOUJG.js} +2 -2
- package/dist/{chunk-SXNQHIBY.js → chunk-PVVHWLNX.js} +1 -1
- package/dist/{chunk-FXOYA2VJ.js → chunk-PZHO4FEN.js} +1 -1
- package/dist/{chunk-ESZHN7PV.js → chunk-Q7DVGUML.js} +1 -1
- package/dist/{chunk-355CRSFS.js → chunk-QAIMZN7M.js} +11 -11
- package/dist/{chunk-WOXQODYQ.js → chunk-QEDVXD3L.js} +1 -1
- package/dist/{chunk-OTVK7DJM.js → chunk-QOJ2UNS5.js} +1 -1
- package/dist/{chunk-MS5APD3V.js → chunk-R6TDZ7T5.js} +1 -1
- package/dist/{chunk-C6YAFZG3.js → chunk-R72ZKZDP.js} +2 -2
- package/dist/chunk-R7KRBKFH.js +5 -0
- package/dist/{chunk-JFV5CQN4.js → chunk-RMSF4UCJ.js} +1 -1
- package/dist/{chunk-3NRQNKVP.js → chunk-RNBC6V2D.js} +10 -10
- package/dist/chunk-RQBQETXQ.js +11 -0
- package/dist/chunk-S43DAIIB.js +9 -0
- package/dist/{chunk-RDYFZHT3.js → chunk-SAASFWKB.js} +1 -1
- package/dist/chunk-SCZUDGRZ.js +2 -0
- package/dist/{chunk-AFYLVV74.js → chunk-SEP35R2E.js} +1 -1
- package/dist/{chunk-SXQZ5GTA.js → chunk-SGBR443F.js} +5 -5
- package/dist/{chunk-JH4ZCPHW.js → chunk-SKRFI6WB.js} +12 -12
- package/dist/chunk-SUYQ7QYB.js +13 -0
- package/dist/{chunk-BTRV3SMB.js → chunk-SWJXWDKX.js} +1 -1
- package/dist/{chunk-PCTOL2FX.js → chunk-T74FGTLW.js} +6 -6
- package/dist/{chunk-KQOY4RGP.js → chunk-TA4JGC5C.js} +1 -1
- package/dist/{chunk-GOZO6LU2.js → chunk-TXKTITMF.js} +6 -6
- package/dist/{chunk-CRILBBSU.js → chunk-TZXAW32T.js} +1 -1
- package/dist/{chunk-SX5BSWTN.js → chunk-UG42KUCT.js} +5 -5
- package/dist/{chunk-OPN4I565.js → chunk-UTITWGVW.js} +1 -1
- package/dist/{chunk-7TZV6G2F.js → chunk-UVMM7AYO.js} +1 -1
- package/dist/{chunk-4QK4WNPB.js → chunk-UWJNQH2X.js} +1 -1
- package/dist/{chunk-6UBOLLBC.js → chunk-V64CJHMY.js} +19 -19
- package/dist/{chunk-ZD36QKQS.js → chunk-VEGZVUHE.js} +1 -1
- package/dist/chunk-VEZHFONL.js +9 -0
- package/dist/{chunk-TQE6O2JA.js → chunk-VPEH3THH.js} +2 -2
- package/dist/{chunk-NU5HN3FZ.js → chunk-VU5P4ZM5.js} +11 -11
- package/dist/{chunk-CLTRQ7AQ.js → chunk-VVDK7XPH.js} +1 -1
- package/dist/{chunk-XQZL6JDD.js → chunk-VZ52KKNA.js} +6 -6
- package/dist/{chunk-P3RXXWXN.js → chunk-WEEQDPU3.js} +5 -5
- package/dist/{chunk-EN5NXWT6.js → chunk-WOOKUEED.js} +1 -1
- package/dist/{chunk-72LJMEL6.js → chunk-X2DUOIJP.js} +1 -1
- package/dist/{chunk-C764JODK.js → chunk-Y4RHGLXB.js} +1 -1
- package/dist/{chunk-ECJKIPWU.js → chunk-YOXR3VKO.js} +1 -1
- package/dist/{chunk-QVZKRROQ.js → chunk-YQLKZ5UQ.js} +1 -1
- package/dist/{chunk-X55LUERI.js → chunk-YUAF3FDE.js} +4 -4
- package/dist/{chunk-JTMEFXRL.js → chunk-ZKBGUDNB.js} +1 -1
- package/dist/{chunk-IBS7647X.js → chunk-ZOQVYSTB.js} +21 -21
- package/dist/{chunk-5CXFABVD.js → chunk-ZOQXFS3R.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/format/index.js +1 -1
- package/dist/forms/BorderInput.js +1 -1
- package/dist/forms/BrandAssetEditor.js +1 -1
- package/dist/forms/Calendar.js +1 -1
- package/dist/forms/ColorPicker.js +1 -1
- package/dist/forms/ComposerAttachments.js +1 -1
- package/dist/forms/CornersInput.js +1 -1
- package/dist/forms/DatePicker.js +1 -1
- package/dist/forms/DateRangePicker.js +1 -1
- package/dist/forms/DateTimePicker.js +1 -1
- package/dist/forms/DisplayChips.js +1 -1
- package/dist/forms/FilePicker.js +1 -1
- package/dist/forms/FormErrorSummary.js +1 -1
- package/dist/forms/IconPicker.js +1 -1
- package/dist/forms/ImageFocusPoint.js +1 -1
- package/dist/forms/Input.js +1 -1
- package/dist/forms/InputNumber.js +1 -1
- package/dist/forms/LinkPicker.d.ts +22 -0
- package/dist/forms/LinkPicker.js +1 -1
- package/dist/forms/MediaLibrary.js +1 -1
- package/dist/forms/MediaUploadField.js +1 -1
- package/dist/forms/MediaUploadGrid.js +1 -1
- package/dist/forms/MediaUsedInList.js +1 -1
- package/dist/forms/NumericKeypad.js +1 -1
- package/dist/forms/PositionInput.js +1 -1
- package/dist/forms/RenameField.js +1 -1
- package/dist/forms/Select.js +1 -1
- package/dist/forms/SidesInput.js +1 -1
- package/dist/forms/Slider.js +1 -1
- package/dist/forms/Snippet.js +1 -1
- package/dist/forms/SplitButton.js +1 -1
- package/dist/forms/TagInput.js +1 -1
- package/dist/forms/TextToolbar.js +1 -1
- package/dist/forms/TimePicker.js +1 -1
- package/dist/forms/WidthsBar.js +1 -1
- package/dist/forms/mediaLibraryMenu.js +1 -1
- package/dist/forms/mediaMoveItems.js +1 -1
- package/dist/forms/textAlign.js +1 -1
- package/dist/forms/useFileIntake.js +1 -1
- package/dist/icons/index.js +1 -1
- package/dist/index.js +666 -666
- package/dist/locales/zh-Hans.js +1 -1
- package/dist/map/index.js +3 -3
- package/dist/markdown/index.js +1 -1
- package/dist/page-tabs/index.js +5 -5
- package/dist/pdf/index.js +1 -1
- package/dist/shell/Accordion.js +1 -1
- package/dist/shell/AppUpdateBanner.js +1 -1
- package/dist/shell/Avatar.js +1 -1
- package/dist/shell/Banner.js +1 -1
- package/dist/shell/Breadcrumbs.js +1 -1
- package/dist/shell/BudgetBar.js +1 -1
- package/dist/shell/Card.js +1 -1
- package/dist/shell/ColoredBadge.js +1 -1
- package/dist/shell/ConfirmDialog.js +1 -1
- package/dist/shell/ContainerFillChart.js +1 -1
- package/dist/shell/ContextMenu.js +1 -1
- package/dist/shell/CountBadge.js +1 -1
- package/dist/shell/Dialog.js +1 -1
- package/dist/shell/Drawer.js +1 -1
- package/dist/shell/DropdownMenu.js +1 -1
- package/dist/shell/EditableGrid.js +1 -1
- package/dist/shell/EmptyState.js +1 -1
- package/dist/shell/GlobalSearch.js +1 -1
- package/dist/shell/HelpCenter.js +1 -1
- package/dist/shell/IconRail.js +1 -1
- package/dist/shell/ImageLightbox.js +1 -1
- package/dist/shell/ItemCount.js +1 -1
- package/dist/shell/LanguageSelect.js +1 -1
- package/dist/shell/Markdown.js +1 -1
- package/dist/shell/MetricBar.js +1 -1
- package/dist/shell/MetricBarLegend.js +1 -1
- package/dist/shell/MilestoneTimeline.js +1 -1
- package/dist/shell/PageHeader.js +1 -1
- package/dist/shell/PopupMenu.js +1 -1
- package/dist/shell/ProductionTimeline.js +1 -1
- package/dist/shell/ResizeHandle.js +1 -1
- package/dist/shell/Result.js +1 -1
- package/dist/shell/SearchableSelect.js +1 -1
- package/dist/shell/SettingReset.js +1 -1
- package/dist/shell/SettingRow.js +1 -1
- package/dist/shell/SidebarLayout.js +1 -1
- package/dist/shell/SidebarNav.js +1 -1
- package/dist/shell/SortableList.js +1 -1
- package/dist/shell/Statistic.js +1 -1
- package/dist/shell/StepChain.js +1 -1
- package/dist/shell/Stepper.js +1 -1
- package/dist/shell/TimeAgo.js +1 -1
- package/dist/shell/TimelineTrack.js +1 -1
- package/dist/shell/TopNav.js +1 -1
- package/dist/shell/TransferProgress.js +1 -1
- package/dist/shell/Tree.js +1 -1
- package/dist/shell/discardGuard.js +1 -1
- package/dist/shell/language.js +1 -1
- package/dist/shell/strings.d.ts +263 -0
- package/dist/shell/strings.js +1 -1
- package/dist/shell/toast.js +1 -1
- package/dist/telemetry/index.js +1 -1
- package/dist/templates/AuthScreen.js +1 -1
- package/dist/templates/ChatTemplate.js +1 -1
- package/dist/templates/CheckoutTemplate.js +1 -1
- package/dist/templates/DashboardTemplate.js +1 -1
- package/dist/templates/DataTablePage.js +1 -1
- package/dist/templates/EmailTemplate.js +1 -1
- package/dist/templates/ErrorBoundary.js +1 -1
- package/dist/templates/ErrorPage.js +1 -1
- package/dist/templates/FormLayoutPage.js +1 -1
- package/dist/templates/GalleryTemplate.js +1 -1
- package/dist/ui/index.js +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -6
- package/dist/Documents-SDOY3ZA3.js +0 -52
- package/dist/PdfViewer-Y3SAVADX.js +0 -1
- package/dist/Sidebar-GQX7UM3M.js +0 -44
- package/dist/Spreadsheet-Q5N5KXGP.js +0 -37
- package/dist/chunk-34H3CK7R.js +0 -22
- package/dist/chunk-56KADF2B.js +0 -11
- package/dist/chunk-7GTUUBS2.js +0 -28
- package/dist/chunk-7INZ7O3A.js +0 -5
- package/dist/chunk-CZMSOB2T.js +0 -9
- package/dist/chunk-EUAC2T5D.js +0 -2
- package/dist/chunk-FO6UPEZH.js +0 -7
- package/dist/chunk-FSUQTN34.js +0 -14
- package/dist/chunk-GDQJBQ5B.js +0 -1
- package/dist/chunk-IYXNRNAF.js +0 -8
- package/dist/chunk-JNQF5CBB.js +0 -6
- package/dist/chunk-K4JQ3FQI.js +0 -2
- package/dist/chunk-L7XIGRIT.js +0 -6
- package/dist/chunk-LGDMGDSV.js +0 -14
- package/dist/chunk-LKTUUNGJ.js +0 -1
- package/dist/chunk-PLK2WHZG.js +0 -27
- package/dist/chunk-RABYGQQU.js +0 -8
- package/dist/chunk-RK7MN5L5.js +0 -3
- package/dist/chunk-RPL4H6LE.js +0 -9
- package/dist/chunk-UGGHQYDN.js +0 -11
- package/dist/chunk-WUAKIM2B.js +0 -7
- package/dist/chunk-XZAEEX2H.js +0 -13
- package/dist/chunk-ZS3TIQQ4.js +0 -20
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
import{toast_default as e}from"./chunk-
|
|
1
|
+
import{toast_default as e}from"./chunk-KVVZLEUG.js";import{useShellStrings as t}from"./chunk-5YP7MFPK.js";import{forwardRef as n,useRef as r,useState as o,useMemo as i,useEffect as a,useImperativeHandle as l}from"react";import{jsx as c,jsxs as s,Fragment as d}from"react/jsx-runtime";var u=["#ef4444","#f97316","#eab308","#22c55e","#3b82f6","#8b5cf6","#000000","#ffffff"],h=[{id:"system",name:"fontSystem",css:"-apple-system, system-ui, sans-serif"},{id:"serif",name:"fontSerif",css:'Georgia, "Times New Roman", serif'},{id:"mono",name:"fontMono",css:'ui-monospace, "SF Mono", Menlo, monospace'},{id:"cursive",name:"fontCursive",css:'"Brush Script MT", "Comic Sans MS", cursive'}],p=()=>Math.random().toString(36).slice(2,9),x=n(function({src:n,filename:x,onApply:m,onCancel:g},N){const L=r(null),z=r(null),D=r(null),P=r(null),E=t().annotator,$=r(E);$.current=E;const[I,S]=o("select"),[W,B]=o(u[0]),[R,j]=o(4),[F,H]=o(24),[T,U]=o(h[0].id),[A,K]=o(!0),[O,V]=o(!1),[Z,G]=o(!1),[X,Y]=o(null),[q,_]=o(null),[J,Q]=o(6),[ee,te]=o(12),[ne,re]=o([]),[oe,ie]=o(null),[ae,le]=o(null),[ce,se]=o(null),[de,ue]=o(1),[he,pe]=o(null),[xe,ye]=o(null),[me,ge]=o(null),fe=r(null),[we,be]=o(!1),ve=i(()=>ce?{w:ce.w*de,h:ce.h*de}:null,[ce,de]),ke=ve&&ae?ve.w/ae.w:1,Me=i(()=>ne.find(e=>e.id===oe)??null,[ne,oe]);a(()=>{"select"===I&&Me&&("color"in Me&&B(Me.color),"stroke"in Me&&j(Me.stroke),"rect"===Me.type&&te(Me.radius),"text"===Me.type&&(H(Me.size),U(Me.font),K(Me.bold),V(Me.italic),G(Me.underline),Y(Me.borderColor),_(Me.background),Q(Me.padding)))},[oe]),a(()=>{const t=new Image;t.crossOrigin="anonymous",t.onload=()=>{P.current=t,le({w:t.naturalWidth,h:t.naturalHeight}),re([]),ie(null)},t.onerror=()=>e.error($.current.loadFailed),t.src=n},[n]),a(()=>{if(!ae)return;const e=()=>{const e=L.current;if(!e)return;const t=e.getBoundingClientRect(),n=Math.max(0,t.width-32),r=Math.max(0,t.height-32);if(0===n||0===r)return;const o=ae.w/ae.h;let i=ae.w,a=ae.h;i>n&&(i=n,a=i/o),a>r&&(a=r,i=a*o),se({w:i,h:a})};e();const t=new ResizeObserver(e);return L.current&&t.observe(L.current),()=>t.disconnect()},[ae]);const Ne=i(()=>ne.filter(e=>"mosaic"===e.type),[ne]);a(()=>{const e=P.current,t=z.current;if(!e||!t||!ae)return;t.width=ae.w,t.height=ae.h;const n=t.getContext("2d");n.drawImage(e,0,0);for(const e of Ne)C(n,e)},[ae,Ne,ce]);const Ce=e=>{const t=D.current;if(!t)return{x:0,y:0};const n=t.createSVGPoint();n.x=e.clientX,n.y=e.clientY;const r=t.getScreenCTM();if(!r)return{x:0,y:0};const o=n.matrixTransform(r.inverse());return{x:o.x,y:o.y}},Le=e=>{fe.current=e,be(!0)};a(()=>{if(!we)return;const e=e=>{const t=fe.current;if(!t)return;const n=Ce(e);if("draw"===t.kind)pe(b(I,t.start,n,W,R,ee));else if("pen"===t.kind){const e=t.points[t.points.length-1];(Math.abs(n.x-e.x)>1||Math.abs(n.y-e.y)>1)&&(t.points.push(n),pe({id:"",type:"draw",points:t.points.slice(),color:W,stroke:R}))}else if("crop"===t.kind)ge(M(t.start,n));else if("move"===t.kind){const e=n.x-t.start.x,r=n.y-t.start.y;re(n=>n.map(n=>n.id===t.id?v(t.original,e,r):n))}else"resize"===t.kind&&re(e=>e.map(e=>e.id===t.id?function(e,t,n){if("arrow"===e.type)return"start"===t?{...e,x1:n.x,y1:n.y}:"end"===t?{...e,x2:n.x,y2:n.y}:e;if("text"===e.type||"draw"===e.type)return e;const r=e.x,o=e.x+e.w,i=e.y,a=e.y+e.h;let l=r,c=i,s=o,d=a;"nw"===t&&(l=n.x,c=n.y);"ne"===t&&(s=n.x,c=n.y);"se"===t&&(s=n.x,d=n.y);"sw"===t&&(l=n.x,d=n.y);const u=M({x:l,y:c},{x:s,y:d});return{...e,x:u.x,y:u.y,w:u.w,h:u.h}}(t.original,t.corner,n):e))},t=()=>{const e=fe.current;if(fe.current=null,be(!1),"draw"===e?.kind)pe(e=>{if(!e||("arrow"===(t=e).type?Math.abs(t.x2-t.x1)<4&&Math.abs(t.y2-t.y1)<4:"draw"===t.type?t.points.length<2:"w"in t&&"h"in t&&(t.w<4||t.h<4)))return null;var t;const n={...e,id:p()};return re(e=>[...e,n]),ie(n.id),S("select"),null});else if("pen"===e?.kind){if(e.points.length<2)return void pe(null);const t={id:p(),type:"draw",points:e.points,color:W,stroke:R};re(e=>[...e,t]),ie(t.id),S("select"),pe(null)}};return window.addEventListener("pointermove",e),window.addEventListener("pointerup",t),window.addEventListener("pointercancel",t),()=>{window.removeEventListener("pointermove",e),window.removeEventListener("pointerup",t),window.removeEventListener("pointercancel",t)}},[we,I,W,R,ee]);a(()=>{const e=e=>{if(!document.activeElement||!/^(INPUT|TEXTAREA)$/.test(document.activeElement.tagName))return!e.metaKey&&!e.ctrlKey||"z"!==e.key&&"Z"!==e.key||e.shiftKey?void(oe&&("Delete"===e.key||"Backspace"===e.key?(e.preventDefault(),re(e=>e.filter(e=>e.id!==oe)),ie(null)):"Escape"===e.key&&ie(null))):(e.preventDefault(),re(e=>e.slice(0,-1)),void ie(null))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[oe]);const ze=e=>{const t=!{bold:A,italic:O,underline:Z}[e];"bold"===e&&K(t),"italic"===e&&V(t),"underline"===e&&G(t),oe&&re(n=>n.map(n=>n.id===oe&&"text"===n.type?{...n,[e]:t}:n))},De=e=>{Y(e),oe&&re(t=>t.map(t=>t.id===oe&&"text"===t.type?{...t,borderColor:e}:t))},Pe=e=>{_(e),oe&&re(t=>t.map(t=>t.id===oe&&"text"===t.type?{...t,background:e}:t))},Ee=e=>{if(!xe)return;const t=e??xe.value;if(!t.trim())return xe.editingId&&re(e=>e.filter(e=>e.id!==xe.editingId)),void ye(null);if(xe.editingId)re(e=>e.map(e=>e.id===xe.editingId&&"text"===e.type?{...e,text:t}:e));else{const e={id:p(),type:"text",x:xe.x,y:xe.y,text:t,color:W,size:F,font:T,bold:A,italic:O,underline:Z,borderColor:X,background:q,padding:J};re(t=>[...t,e]),ie(e.id),S("select")}ye(null)},$e=async()=>{const e=z.current,t=D.current;if(!e||!t||!ae)return null;const n=document.createElement("canvas");n.width=ae.w,n.height=ae.h;const r=n.getContext("2d");r.drawImage(e,0,0);const o=t.cloneNode(!0);o.querySelectorAll("[data-chrome]").forEach(e=>e.remove());const i=(new XMLSerializer).serializeToString(o),a=new Blob([i],{type:"image/svg+xml;charset=utf-8"}),l=URL.createObjectURL(a),c=new Image;return await new Promise(e=>{c.onload=()=>e(),c.onerror=()=>e(),c.src=l}),r.drawImage(c,0,0,ae.w,ae.h),URL.revokeObjectURL(l),n};l(N,()=>({save:async()=>{const t=await $e();t&&t.toBlob(t=>{if(!t)return void e.error($.current.exportFailed);const n=URL.createObjectURL(t),r=document.createElement("a");r.href=n;const o=x.replace(/\.[^.]+$/,"");r.download=`${o}-annotated.png`,r.click(),URL.revokeObjectURL(n)},"image/png")},copy:async()=>{if(!("clipboard"in navigator)||"undefined"==typeof ClipboardItem)return void e.error($.current.clipboardUnsupported);const t=await $e();t&&t.toBlob(async t=>{if(t)try{await navigator.clipboard.write([new ClipboardItem({"image/png":t})]),e.success($.current.copied)}catch{e.error($.current.copyRefused)}else e.error($.current.copyFailed)},"image/png")}}),[ae,x]);const Ie=i(()=>[{id:"select",label:E.toolSelect,icon:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 3l7 17 2-7 7-2L5 3z"})})},{id:"draw",label:E.toolDraw,icon:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L6.832 19.82a4.5 4.5 0 01-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 011.13-1.897L16.863 4.487z"})})},{id:"rect",label:E.toolRect,icon:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("rect",{x:"4",y:"6",width:"16",height:"12",rx:"3"})})},{id:"circle",label:E.toolEllipse,icon:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("ellipse",{cx:"12",cy:"12",rx:"8",ry:"6"})})},{id:"arrow",label:E.toolArrow,icon:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 19L19 5m0 0h-7m7 0v7"})})},{id:"mosaic",label:E.toolMosaic,icon:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 4h6v6H4zM14 4h6v6h-6zM4 14h6v6H4zM14 14h6v6h-6z"})})},{id:"text",label:E.toolText,icon:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M12 6v14M9 20h6"})})},{id:"crop",label:E.toolCrop,icon:/* @__PURE__ */c("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */c("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 2v15a1 1 0 001 1h15M2 6h15a1 1 0 011 1v15"})})}],[E]),Se=e=>"p-2 rounded transition-colors "+(e?"bg-blue-500 text-on-accent":"text-ink hover:bg-gray-200"),We=Me?.type??("select"===I?null:I),Be="rect"===We||"circle"===We||"arrow"===We||"draw"===We,Re="rect"===We,je="text"===We;/* @__PURE__ */
|
|
2
2
|
return s("div",{className:"flex flex-col h-full bg-gray-100",children:[
|
|
3
3
|
/* @__PURE__ */s("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-line bg-surface shrink-0 flex-wrap text-xs",children:[Ie.map(e=>/* @__PURE__ */c("button",{onClick:()=>{S(e.id),ie(null)},title:e.label,className:Se(I===e.id),children:e.icon},e.id)),
|
|
4
4
|
/* @__PURE__ */c("div",{className:"h-5 w-px bg-gray-300 mx-1"}),
|
|
5
5
|
/* @__PURE__ */c("div",{className:"flex items-center gap-1",children:u.map(e=>/* @__PURE__ */c("button",{onClick:()=>(e=>{B(e),oe&&re(t=>t.map(t=>t.id!==oe||"mosaic"===t.type?t:{...t,color:e}))})(e),title:e,className:"h-5 w-5 rounded-full border "+(W===e?"ring-2 ring-blue-500 ring-offset-1":"border-gray-300"),style:{background:e}},e))}),Be&&/* @__PURE__ */s(d,{children:[
|
|
6
6
|
/* @__PURE__ */c("div",{className:"h-5 w-px bg-gray-300 mx-1"}),
|
|
7
7
|
/* @__PURE__ */s("label",{className:"flex items-center gap-2 text-gray-600",children:[
|
|
8
|
-
/* @__PURE__ */c("span",{children:
|
|
8
|
+
/* @__PURE__ */c("span",{children:E.weight}),
|
|
9
9
|
/* @__PURE__ */c("input",{type:"range",min:1,max:20,step:1,value:R,onChange:e=>{return t=Number(e.target.value),j(t),void(oe&&re(e=>e.map(e=>e.id!==oe?e:"rect"===e.type||"circle"===e.type||"arrow"===e.type||"draw"===e.type?{...e,stroke:t}:e)));var t},className:"w-16 accent-blue-500"}),
|
|
10
10
|
/* @__PURE__ */c("span",{className:"tabular-nums w-5 text-right",children:R})]})]}),Re&&/* @__PURE__ */s(d,{children:[
|
|
11
11
|
/* @__PURE__ */c("div",{className:"h-5 w-px bg-gray-300 mx-1"}),
|
|
12
12
|
/* @__PURE__ */s("label",{className:"flex items-center gap-2 text-gray-600",children:[
|
|
13
|
-
/* @__PURE__ */c("span",{children:
|
|
13
|
+
/* @__PURE__ */c("span",{children:E.radius}),
|
|
14
14
|
/* @__PURE__ */c("input",{type:"range",min:0,max:48,step:1,value:ee,onChange:e=>{return t=Number(e.target.value),te(t),void(oe&&re(e=>e.map(e=>e.id===oe&&"rect"===e.type?{...e,radius:t}:e)));var t},className:"w-16 accent-blue-500"}),
|
|
15
15
|
/* @__PURE__ */c("span",{className:"tabular-nums w-6 text-right",children:ee})]})]}),je&&/* @__PURE__ */s(d,{children:[
|
|
16
16
|
/* @__PURE__ */c("div",{className:"h-5 w-px bg-gray-300 mx-1"}),
|
|
17
|
-
/* @__PURE__ */c("select",{value:T,onChange:e=>{return t=e.target.value,U(t),void(oe&&re(e=>e.map(e=>e.id===oe&&"text"===e.type?{...e,font:t}:e)));var t},className:"text-xs border border-gray-300 rounded px-1 py-0.5 bg-white",children:h.map(e=>/* @__PURE__ */c("option",{value:e.id,children:
|
|
18
|
-
/* @__PURE__ */c("button",{onClick:()=>ze("bold"),className:Se(A),title:
|
|
19
|
-
/* @__PURE__ */c("button",{onClick:()=>ze("italic"),className:Se(
|
|
20
|
-
/* @__PURE__ */c("button",{onClick:()=>ze("underline"),className:Se(Z),title:
|
|
17
|
+
/* @__PURE__ */c("select",{value:T,onChange:e=>{return t=e.target.value,U(t),void(oe&&re(e=>e.map(e=>e.id===oe&&"text"===e.type?{...e,font:t}:e)));var t},className:"text-xs border border-gray-300 rounded px-1 py-0.5 bg-white",children:h.map(e=>/* @__PURE__ */c("option",{value:e.id,children:E[e.name]},e.id))}),
|
|
18
|
+
/* @__PURE__ */c("button",{onClick:()=>ze("bold"),className:Se(A),title:E.bold,children:/* @__PURE__ */c("span",{className:"font-bold",children:E.boldLetter})}),
|
|
19
|
+
/* @__PURE__ */c("button",{onClick:()=>ze("italic"),className:Se(O),title:E.italic,children:/* @__PURE__ */c("span",{className:"italic",children:E.italicLetter})}),
|
|
20
|
+
/* @__PURE__ */c("button",{onClick:()=>ze("underline"),className:Se(Z),title:E.underline,children:/* @__PURE__ */c("span",{className:"underline",children:E.underlineLetter})}),
|
|
21
21
|
/* @__PURE__ */s("label",{className:"flex items-center gap-2 text-gray-600",children:[
|
|
22
|
-
/* @__PURE__ */c("span",{children:
|
|
23
|
-
/* @__PURE__ */c("input",{type:"range",min:10,max:96,step:1,value:
|
|
24
|
-
/* @__PURE__ */c("span",{className:"tabular-nums w-7 text-right",children:
|
|
22
|
+
/* @__PURE__ */c("span",{children:E.size}),
|
|
23
|
+
/* @__PURE__ */c("input",{type:"range",min:10,max:96,step:1,value:F,onChange:e=>{return t=Number(e.target.value),H(t),void(oe&&re(e=>e.map(e=>e.id===oe&&"text"===e.type?{...e,size:t}:e)));var t},className:"w-16 accent-blue-500"}),
|
|
24
|
+
/* @__PURE__ */c("span",{className:"tabular-nums w-7 text-right",children:F})]}),
|
|
25
25
|
/* @__PURE__ */s("label",{className:"flex items-center gap-1 text-gray-600",children:[
|
|
26
|
-
/* @__PURE__ */c("span",{children:
|
|
27
|
-
/* @__PURE__ */c("input",{type:"color",value:
|
|
28
|
-
/* @__PURE__ */c("button",{onClick:()=>De(null),title:
|
|
26
|
+
/* @__PURE__ */c("span",{children:E.border}),X?/* @__PURE__ */s(d,{children:[
|
|
27
|
+
/* @__PURE__ */c("input",{type:"color",value:X,onChange:e=>De(e.target.value),title:E.borderColor,className:"h-5 w-6 rounded border border-gray-300 bg-white p-0 cursor-pointer"}),
|
|
28
|
+
/* @__PURE__ */c("button",{onClick:()=>De(null),title:E.removeBorder,className:"px-0.5 text-gray-400 hover:text-gray-700",children:"✕"})]}):/* @__PURE__ */c("button",{onClick:()=>De(W),title:E.addBorder,className:"px-2 py-0.5 rounded border border-line-strong text-gray-600 hover:bg-gray-100",children:E.add})]}),
|
|
29
29
|
/* @__PURE__ */s("label",{className:"flex items-center gap-1 text-gray-600",children:[
|
|
30
|
-
/* @__PURE__ */c("span",{children:
|
|
31
|
-
/* @__PURE__ */c("input",{type:"color",value:
|
|
32
|
-
/* @__PURE__ */c("button",{onClick:()=>
|
|
30
|
+
/* @__PURE__ */c("span",{children:E.fill}),q?/* @__PURE__ */s(d,{children:[
|
|
31
|
+
/* @__PURE__ */c("input",{type:"color",value:q,onChange:e=>Pe(e.target.value),title:E.fillColor,className:"h-5 w-6 rounded border border-gray-300 bg-white p-0 cursor-pointer"}),
|
|
32
|
+
/* @__PURE__ */c("button",{onClick:()=>Pe(null),title:E.removeFill,className:"px-0.5 text-gray-400 hover:text-gray-700",children:"✕"})]}):/* @__PURE__ */c("button",{onClick:()=>Pe("#ffffff"),title:E.addFill,className:"px-2 py-0.5 rounded border border-line-strong text-gray-600 hover:bg-gray-100",children:E.add})]}),
|
|
33
33
|
/* @__PURE__ */s("label",{className:"flex items-center gap-2 text-gray-600",children:[
|
|
34
|
-
/* @__PURE__ */c("span",{children:
|
|
35
|
-
/* @__PURE__ */c("input",{type:"range",min:0,max:40,step:1,value:
|
|
36
|
-
/* @__PURE__ */c("span",{className:"tabular-nums w-6 text-right",children:
|
|
34
|
+
/* @__PURE__ */c("span",{children:E.padding}),
|
|
35
|
+
/* @__PURE__ */c("input",{type:"range",min:0,max:40,step:1,value:J,onChange:e=>{return t=Number(e.target.value),Q(t),void(oe&&re(e=>e.map(e=>e.id===oe&&"text"===e.type?{...e,padding:t}:e)));var t},className:"w-14 accent-blue-500"}),
|
|
36
|
+
/* @__PURE__ */c("span",{className:"tabular-nums w-6 text-right",children:J})]})]}),
|
|
37
37
|
/* @__PURE__ */c("div",{className:"h-5 w-px bg-gray-300 mx-1"}),
|
|
38
|
-
/* @__PURE__ */c("button",{onClick:()=>ue(e=>Math.max(.25,Math.round(100*(e-.25))/100)),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-700",title:
|
|
38
|
+
/* @__PURE__ */c("button",{onClick:()=>ue(e=>Math.max(.25,Math.round(100*(e-.25))/100)),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-700",title:E.zoomOut,children:"−"}),
|
|
39
39
|
/* @__PURE__ */s("span",{className:"text-gray-600 tabular-nums w-10 text-center",children:[Math.round(100*de),"%"]}),
|
|
40
|
-
/* @__PURE__ */c("button",{onClick:()=>ue(e=>Math.min(4,Math.round(100*(e+.25))/100)),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-700",title:
|
|
41
|
-
/* @__PURE__ */c("button",{onClick:()=>ue(1),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-700",title:
|
|
40
|
+
/* @__PURE__ */c("button",{onClick:()=>ue(e=>Math.min(4,Math.round(100*(e+.25))/100)),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-700",title:E.zoomIn,children:"+"}),
|
|
41
|
+
/* @__PURE__ */c("button",{onClick:()=>ue(1),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-700",title:E.fitHint,children:E.fit}),
|
|
42
42
|
/* @__PURE__ */c("div",{className:"h-5 w-px bg-gray-300 mx-1"}),
|
|
43
|
-
/* @__PURE__ */c("button",{onClick:()=>{re(e=>e.slice(0,-1)),ie(null)},disabled:0===ne.length,className:"px-2 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-700",children:
|
|
43
|
+
/* @__PURE__ */c("button",{onClick:()=>{re(e=>e.slice(0,-1)),ie(null)},disabled:0===ne.length,className:"px-2 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-700",children:E.undo}),
|
|
44
44
|
/* @__PURE__ */s("div",{className:"ml-auto flex items-center gap-2",children:[me&&/* @__PURE__ */s(d,{children:[
|
|
45
|
-
/* @__PURE__ */c("button",{onClick:()=>{if(!me||!
|
|
46
|
-
/* @__PURE__ */c("button",{onClick:()=>ge(null),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-700",children:
|
|
47
|
-
/* @__PURE__ */c("button",{onClick:async()=>{const t=await $e();t?t.toBlob(t=>{t?m(t):e.error($.current.exportFailed)},"image/png"):e.error($.current.exportFailed)},className:"px-3 py-1 rounded bg-blue-500 text-white hover:bg-blue-600 text-xs font-medium",children:
|
|
45
|
+
/* @__PURE__ */c("button",{onClick:()=>{if(!me||!P.current||!ae)return;const e=me,t=document.createElement("canvas");t.width=Math.round(e.w),t.height=Math.round(e.h);const n=t.getContext("2d"),r=document.createElement("canvas");r.width=ae.w,r.height=ae.h;const o=r.getContext("2d");o.drawImage(P.current,0,0);for(const e of Ne)C(o,e);n.drawImage(r,e.x,e.y,e.w,e.h,0,0,e.w,e.h);const i=new Image;i.onload=()=>{P.current=i,le({w:i.naturalWidth,h:i.naturalHeight}),re(t=>t.filter(e=>"mosaic"!==e.type).map(t=>v(t,-e.x,-e.y)).filter(e=>function(e,t,n){const r=k(e);return r.x+r.w>0&&r.y+r.h>0&&r.x<t&&r.y<n}(e,i.naturalWidth,i.naturalHeight))),ge(null)},i.src=t.toDataURL("image/png")},className:"px-2 py-1 rounded bg-blue-500 text-white hover:bg-blue-600",children:E.applyCrop}),
|
|
46
|
+
/* @__PURE__ */c("button",{onClick:()=>ge(null),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-700",children:E.cancel})]}),m&&!me&&/* @__PURE__ */s(d,{children:[g&&/* @__PURE__ */c("button",{onClick:g,className:"px-3 py-1 rounded hover:bg-gray-200 text-gray-700 text-xs font-medium",children:E.cancel}),
|
|
47
|
+
/* @__PURE__ */c("button",{onClick:async()=>{const t=await $e();t?t.toBlob(t=>{t?m(t):e.error($.current.exportFailed)},"image/png"):e.error($.current.exportFailed)},className:"px-3 py-1 rounded bg-blue-500 text-white hover:bg-blue-600 text-xs font-medium",children:E.apply})]})]})]}),
|
|
48
48
|
/* @__PURE__ */c("div",{ref:L,className:"flex-1 overflow-auto bg-gray-200 flex items-center justify-center p-4 relative",children:ve&&ae&&/* @__PURE__ */s("div",{className:"relative shadow-lg rounded overflow-hidden bg-white shrink-0",style:{width:ve.w,height:ve.h},children:[
|
|
49
49
|
/* @__PURE__ */c("canvas",{ref:z,style:{position:"absolute",inset:0,width:"100%",height:"100%",display:"block"}}),
|
|
50
|
-
/* @__PURE__ */s("svg",{ref:D,viewBox:`0 0 ${ae.w} ${ae.h}`,preserveAspectRatio:"none",style:{position:"absolute",inset:0,width:"100%",height:"100%",touchAction:"none",cursor:"select"===I?"default":"text"===I?"text":"crosshair"},onPointerDown:e=>{if("select"===I)return void ie(null);if("text"===I){if(xe)return void
|
|
51
|
-
/* @__PURE__ */c("div",{className:"px-3 py-2 border-t border-line bg-surface text-2xs text-ink-faint shrink-0",children:"select"===I?oe?
|
|
50
|
+
/* @__PURE__ */s("svg",{ref:D,viewBox:`0 0 ${ae.w} ${ae.h}`,preserveAspectRatio:"none",style:{position:"absolute",inset:0,width:"100%",height:"100%",touchAction:"none",cursor:"select"===I?"default":"text"===I?"text":"crosshair"},onPointerDown:e=>{if("select"===I)return void ie(null);if("text"===I){if(xe)return void Ee();const t=Ce(e);return void ye({x:t.x,y:t.y,value:""})}const t=Ce(e);if("crop"!==I){if("draw"===I)return Le({kind:"pen",points:[t]}),void pe({id:"",type:"draw",points:[t],color:W,stroke:R});pe(b(I,t,t,W,R,ee)),Le({kind:"draw",start:t})}else Le({kind:"crop",start:t})},children:[ne.map(e=>/* @__PURE__ */c(y,{anno:e,selected:oe===e.id,zoom:de,onPointerDown:t=>((e,t)=>{"select"===I&&(e.stopPropagation(),ie(t.id),Le({kind:"move",id:t.id,start:Ce(e),original:t}))})(t,e),onDoubleClick:()=>{var t;"text"===(t=e).type&&ye({x:t.x,y:t.y,value:t.text,editingId:t.id})},onHandlePointerDown:(t,n)=>((e,t,n)=>{e.stopPropagation(),Le({kind:"resize",id:t.id,corner:n,start:Ce(e),original:t})})(t,e,n)},e.id)),he&&/* @__PURE__ */c(y,{anno:{...he,id:"__preview"},preview:!0}),me&&/* @__PURE__ */c(f,{rect:me,imageSize:ae})]}),xe&&/* @__PURE__ */c(w,{pendingText:xe,color:W,size:F,font:h.find(e=>e.id===T)?.css??h[0].css,bold:A,italic:O,underline:Z,borderColor:X,background:q,padding:J,scale:ke,onChange:e=>ye({...xe,value:e}),onCommit:Ee,onCancel:()=>ye(null)})]})}),
|
|
51
|
+
/* @__PURE__ */c("div",{className:"px-3 py-2 border-t border-line bg-surface text-2xs text-ink-faint shrink-0",children:"select"===I?oe?E.hintSelected:E.hintSelect:"text"===I?E.hintText:"crop"===I?E.hintCrop:"draw"===I?E.hintDraw:E.hintShape})]})});function y({anno:e,selected:t,preview:n,zoom:r=1,onPointerDown:o,onDoubleClick:i,onHandlePointerDown:a}){const l=k(e),u=o?{onPointerDown:o,pointerEvents:"all",style:{cursor:"move"}}:{},p=i?{onDoubleClick:i}:{};let x;if("rect"===e.type)x=/* @__PURE__ */c("rect",{x:e.x,y:e.y,width:e.w,height:e.h,rx:e.radius,ry:e.radius,fill:"none",stroke:e.color,strokeWidth:e.stroke,strokeLinecap:"round",strokeLinejoin:"round",...u});else if("circle"===e.type)x=/* @__PURE__ */c("ellipse",{cx:e.x+e.w/2,cy:e.y+e.h/2,rx:e.w/2,ry:e.h/2,fill:"none",stroke:e.color,strokeWidth:e.stroke,...u});else if("arrow"===e.type)x=/* @__PURE__ */c(g,{anno:e,interactive:u});else if("draw"===e.type)x=/* @__PURE__ */c("path",{d:N(e.points),fill:"none",stroke:e.color,strokeWidth:e.stroke,strokeLinecap:"round",strokeLinejoin:"round",...u});else if("mosaic"===e.type)x=/* @__PURE__ */c("rect",{x:e.x,y:e.y,width:e.w,height:e.h,fill:"rgba(0,0,0,0.001)",stroke:t?"#3b82f6":"none",strokeWidth:t?2:0,strokeDasharray:t?"6,4":void 0,...u});else{const t=h.find(t=>t.id===e.font)?.css??h[0].css,n=e.padding??0,r=!!e.borderColor||!!e.background,o=k(e),i=e.borderColor?Math.max(1,Math.round(e.size/12)):0;x=/* @__PURE__ */s("g",{...u,...p,children:[r&&/* @__PURE__ */c("rect",{x:o.x-n,y:o.y-n,width:Math.max(0,o.w)+2*n,height:Math.max(0,o.h)+2*n,rx:Math.min(8,n),ry:Math.min(8,n),fill:e.background??"none",stroke:e.borderColor??"none",strokeWidth:i}),
|
|
52
52
|
/* @__PURE__ */c("text",{x:e.x,y:e.y+e.size,fill:e.color,fontSize:e.size,fontWeight:e.bold?700:400,fontStyle:e.italic?"italic":"normal",textDecoration:e.underline?"underline":void 0,fontFamily:t,style:{userSelect:"none"},children:e.text.split("\n").map((t,n)=>/* @__PURE__ */c("tspan",{x:e.x,dy:0===n?0:1.2*e.size,children:t},n))})]})}/* @__PURE__ */
|
|
53
53
|
return s("g",{children:[x,t&&!n&&/* @__PURE__ */s(d,{children:[
|
|
54
54
|
/* @__PURE__ */c("rect",{"data-chrome":"selection",x:l.x-4,y:l.y-4,width:l.w+8,height:l.h+8,fill:"none",stroke:"#3b82f6",strokeWidth:2/r,strokeDasharray:`${6/r},${4/r}`,pointerEvents:"none"}),a&&/* @__PURE__ */c(m,{anno:e,zoom:r,onHandlePointerDown:a})]})]})}function m({anno:e,zoom:t,onHandlePointerDown:n}){const r=6/t,o=1.5/t,i=e=>({fill:"#fff",stroke:"#3b82f6",strokeWidth:o,pointerEvents:"all",style:{cursor:e},"data-chrome":"handle"});if("arrow"===e.type)/* @__PURE__ */
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import{FormField as e}from"./chunk-6KBDNYRW.js";import{zoneFocusClass as t,mediaPromptLine as r,UploadGlyph as a,dropzoneClass as n,BusyOverlay as l,isVideoUrl as i,mediaFileName as o,FilenameBadge as s}from"./chunk-
|
|
2
|
-
return v("div",{...Ce?{"data-grid-item":"","data-grid-id":e.id,role:"option"}:{},...ee?{[m]:""}:{},"aria-selected":Ke?Ke.has(e.id):void 0,onClick:Ce?t=>{t.target.closest?.("button")||
|
|
1
|
+
import{FormField as e}from"./chunk-6KBDNYRW.js";import{zoneFocusClass as t,mediaPromptLine as r,UploadGlyph as a,dropzoneClass as n,BusyOverlay as l,isVideoUrl as i,mediaFileName as o,FilenameBadge as s}from"./chunk-VEGZVUHE.js";import{useFileIntake as d,FileIntakeAlert as c}from"./chunk-ZKBGUDNB.js";import{ColoredBadge as u}from"./chunk-CT7AU2TA.js";import{MENU_ON_MEDIA_ATTR as m}from"./chunk-5QFPTDQF.js";import{Icon as p}from"./chunk-7V32O5NF.js";import{Tooltip as f}from"./chunk-QQ2LDC6C.js";import{useShellStrings as h}from"./chunk-5YP7MFPK.js";import{useId as g,useState as b,useRef as y}from"react";import{jsxs as v,jsx as x}from"react/jsx-runtime";var k=112,D=/* @__PURE__ */x(p,{name:"close",strokeWidth:2,strokeLinecap:"round","aria-hidden":"true",className:"h-3 w-3"});function N({items:p,onPick:k,onFiles:N,onRemove:w,onReorder:j,dragType:K,onDragOutChange:C,dropType:T,onDropData:A,label:F,hint:O,error:P,required:E,className:I,accept:L="image/*",maxSizeBytes:z,maxFiles:S,fit:$="cover",thumbSize:M=96,placeholder:B,cta:H,acceptHint:Q,showCover:R=!1,coverLabel:U,busy:V=!1,busyLabel:W,progress:q,disabled:G=!1,readOnly:Y=!1,selected:Z,onItemClick:J,onItemDoubleClick:X,onItemContextMenu:_,menuOnMedia:ee=!1}){const te=h().media,re=H??te.cta,ae=U??te.cover,ne=W??te.uploading,le=g(),[ie,oe]=b(null),se=G||V,de=!(!k&&!N||se||Y),ce=!!w&&!se&&!Y,ue=!!j&&!se&&!Y,me=!!K&&!G&&!ue,pe=!(!T||!A||se||Y),fe=t(se),he=B??r(L,te),ge=d({accept:L,maxSizeBytes:z,maxFiles:S,acceptHint:Q,multiple:!0,disabled:!de,currentCount:p.length,onAccept:e=>{if(N)N(e);else for(const t of e)k(t)}}),[be,ye]=b(!1),ve=y(0),xe=e=>pe&&Array.from(e.dataTransfer?.types??[]).includes(T),ke=ge.zoneProps,De={onDragEnter:e=>{if(!xe(e))return ke.onDragEnter?.(e);e.preventDefault(),ve.current+=1,ye(!0)},onDragOver:e=>{if(!xe(e))return ke.onDragOver?.(e);e.preventDefault(),e.dataTransfer.dropEffect="link",be||ye(!0)},onDragLeave:e=>{if(!xe(e))return ke.onDragLeave?.(e);ve.current=Math.max(0,ve.current-1),0===ve.current&&ye(!1)},onDrop:e=>{if(!xe(e))return ke.onDrop?.(e);e.preventDefault(),ve.current=0,ye(!1);const t=e.dataTransfer.getData(T);t&&A(t)}},Ne=ge.dragOver||be,we=()=>{de&&(k?k():ge.open())},je={width:M,height:M},Ke=null==Z?null:new Set(Z),Ce=!!J,Te=M<112,Ae=(e,t)=>{const r=e.kind?"video"===e.kind:i(e.url,L),a=e.name??o(e.url),n=R&&(e.cover??0===t);/* @__PURE__ */
|
|
2
|
+
return v("div",{...Ce?{"data-grid-item":"","data-grid-id":e.id,role:"option"}:{},...ee?{[m]:""}:{},"aria-selected":Ke?Ke.has(e.id):void 0,onClick:Ce?t=>{t.target.closest?.("button")||J(e.id,{ctrlKey:t.ctrlKey,metaKey:t.metaKey,shiftKey:t.shiftKey})}:void 0,onDoubleClick:X?()=>X(e.id):void 0,onContextMenu:_?t=>_(e.id,t):void 0,draggable:ue||me&&!!e.dragData||void 0,onDragStart:ue?e=>{e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",String(t)),oe(t)}:me&&e.dragData?t=>{t.dataTransfer.effectAllowed=e.dragAlso?"all":"link",t.dataTransfer.setData(K,e.dragData);for(const[r,a]of Object.entries(e.dragAlso??{}))t.dataTransfer.setData(r,a);C?.("start",e.id)}:void 0,onDragEnd:ue?()=>oe(null):me&&e.dragData&&C?t=>C("none"===t.dataTransfer.dropEffect?"cancelled":"dropped",e.id):void 0,onDragOver:ue?e=>{null!=ie&&(e.preventDefault(),e.stopPropagation())}:void 0,onDrop:ue?e=>{null!=ie&&(e.preventDefault(),e.stopPropagation(),ie!==t&&j(ie,t),oe(null))}:void 0,tabIndex:ue||Ce?0:void 0,"aria-label":ue?te.reorder(a,t+1,p.length):Ce?a:void 0,onKeyDown:Ce&&!ue?t=>{t.target!==t.currentTarget||"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),J(e.id,{ctrlKey:t.ctrlKey,metaKey:t.metaKey,shiftKey:t.shiftKey}))}:ue?e=>{"ArrowLeft"===e.key||"ArrowUp"===e.key?t>0&&(e.preventDefault(),j(t,t-1)):"ArrowRight"!==e.key&&"ArrowDown"!==e.key||t<p.length-1&&(e.preventDefault(),j(t,t+1))}:void 0,className:["relative shrink-0 overflow-hidden rounded-md border border-line bg-gray-100",fe,ie===t?"opacity-50":"",Ke?.has(e.id)?"ring-2 ring-blue-500 ring-offset-1":"",Ce?"cursor-pointer":""].join(" "),style:{...je,cursor:ue?"move":void 0},children:[r?/* @__PURE__ */x("video",{src:e.url,muted:!0,playsInline:!0,preload:"metadata","aria-label":a,className:"h-full w-full",style:{objectFit:$}}):/* @__PURE__ */x("img",{src:e.url,alt:a,className:"h-full w-full",style:{objectFit:$}}),n&&/* @__PURE__ */x("span",{className:"absolute left-1 top-1 rounded bg-accent-fill px-2 py-0.5 text-xs font-medium text-on-accent",children:ae}),!n&&null!=e.mark&&/* @__PURE__ */x("span",{className:"absolute left-1 top-1 inline-flex items-center gap-1 rounded px-2 py-0.5 text-xs font-medium text-on-accent",style:{background:"var(--rosh-media-scrim)"},children:e.mark}),!n&&null==e.mark&&!!e.badges?.length&&
|
|
3
3
|
/* @__PURE__ */x("span",{"data-tile-badges":"",className:"absolute left-1 top-1 flex flex-nowrap items-center gap-1 overflow-hidden rounded-md bg-surface p-0.5 shadow-sm",style:{maxWidth:"calc(100% - 8px)"},children:e.badges.map(e=>/* @__PURE__ */x("span",{"data-tile-badge":"",className:"flex min-w-0",children:Te?
|
|
4
4
|
/* @__PURE__ */x(f,{content:e.label,children:/* @__PURE__ */x("span",{tabIndex:0,"aria-label":e.label,className:`flex rounded-full ${fe}`,children:/* @__PURE__ */x(u,{tone:e.tone,size:"xs",children:/* @__PURE__ */v("span",{"aria-hidden":"true",className:"inline-flex items-center gap-0.5",children:[
|
|
5
|
-
/* @__PURE__ */x("span",{className:"inline-flex h-3 w-3 shrink-0 items-center justify-center",children:e.icon}),null!=e.count&&/* @__PURE__ */x("span",{children:e.count})]})})})}):/* @__PURE__ */x(u,{tone:e.tone,size:"xs",children:e.label})},e.key))}),null!=e.caption&&/* @__PURE__ */x(s,{children:e.caption}),ce&&/* @__PURE__ */x("button",{type:"button",onClick:()=>w(e.id),"aria-label":e.removeLabel??te.removeItem(a),className:`absolute right-1 top-1 flex h-5 w-5 items-center justify-center rounded-full text-white ${fe}`,style:{background:"var(--rosh-media-scrim-button)"},children:D})]},e.id)},
|
|
5
|
+
/* @__PURE__ */x("span",{className:"inline-flex h-3 w-3 shrink-0 items-center justify-center",children:e.icon}),null!=e.count&&/* @__PURE__ */x("span",{children:e.count})]})})})}):/* @__PURE__ */x(u,{tone:e.tone,size:"xs",children:e.label})},e.key))}),null!=e.caption&&/* @__PURE__ */x(s,{children:e.caption}),ce&&/* @__PURE__ */x("button",{type:"button",onClick:()=>w(e.id),"aria-label":e.removeLabel??te.removeItem(a),className:`absolute right-1 top-1 flex h-5 w-5 items-center justify-center rounded-full text-white ${fe}`,style:{background:"var(--rosh-media-scrim-button)"},children:D})]},e.id)},Fe=de&&/* @__PURE__ */v("button",{type:"button",onClick:()=>we(),"aria-label":te.addMedia,className:`flex shrink-0 flex-col items-center justify-center gap-1 rounded-md border-2 border-dashed border-gray-300 bg-gray-50 text-gray-400 transition-colors hover:bg-gray-100 hover:text-gray-500 ${fe}`,style:je,children:[
|
|
6
6
|
/* @__PURE__ */x(a,{className:"h-5 w-5"}),
|
|
7
|
-
/* @__PURE__ */x("span",{className:"text-xs font-medium text-gray-500",children:te.add})]}),
|
|
7
|
+
/* @__PURE__ */x("span",{className:"text-xs font-medium text-gray-500",children:te.add})]}),Oe=de?/* @__PURE__ */v("button",{type:"button",onClick:()=>we(),"aria-label":"string"==typeof he?he:te.upload,className:n(Ne,!1,fe),style:{minHeight:M+32},children:[
|
|
8
8
|
/* @__PURE__ */x("span",{className:"text-ink-faintest",children:/* @__PURE__ */x(a,{})}),
|
|
9
9
|
/* @__PURE__ */x("span",{className:"px-3 text-xs text-ink-faint",children:he}),
|
|
10
|
-
/* @__PURE__ */x("span",{className:"text-sm font-medium text-blue-600",children:re}),
|
|
11
|
-
return v(e,{label:
|
|
12
|
-
/* @__PURE__ */v("div",{id:le,role:"group","aria-labelledby":
|
|
13
|
-
/* @__PURE__ */x("div",{role:"listbox","aria-multiselectable":!!Ke||void 0,"aria-label":"string"==typeof
|
|
10
|
+
/* @__PURE__ */x("span",{className:"text-sm font-medium text-blue-600",children:re}),Q&&/* @__PURE__ */x("span",{className:"text-xs text-ink-faintest",children:Q})]}):/* @__PURE__ */x("div",{className:"flex w-full items-center justify-center rounded-lg border border-line bg-surface-sunken px-3 text-xs text-ink-faintest",style:{minHeight:M+32},children:/* @__PURE__ */x("span",{className:V?"invisible":void 0,children:te.empty})});/* @__PURE__ */
|
|
11
|
+
return v(e,{label:F,labelId:F?`${le}-label`:void 0,htmlFor:le,hint:O,error:P,required:E,className:I,children:[
|
|
12
|
+
/* @__PURE__ */v("div",{id:le,role:"group","aria-labelledby":F?`${le}-label`:void 0,"aria-describedby":P?`${le}-error`:O?`${le}-hint`:void 0,"aria-busy":V||void 0,...ge.zoneProps,...pe?De:{},className:"relative rounded-lg transition-colors",style:{...se?{opacity:.6}:{},...Ne?{boxShadow:"0 0 0 2px var(--rosh-drop-ring)"}:{}},children:[0===p.length?Oe:/* @__PURE__ */v("div",{className:"flex flex-wrap gap-2",children:[Ce?
|
|
13
|
+
/* @__PURE__ */x("div",{role:"listbox","aria-multiselectable":!!Ke||void 0,"aria-label":"string"==typeof F?F:te.files,className:"contents",children:p.map(Ae)}):p.map(Ae),Fe]}),V&&/* @__PURE__ */x(l,{label:ne,progress:q})]}),!k&&N&&/* @__PURE__ */x("input",{...ge.inputProps}),
|
|
14
14
|
/* @__PURE__ */x(c,{rejections:ge.rejections})]})}export{k as FULL_BADGE_TILE_PX,N as MediaUploadGrid};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import{Tree as e,TreeRow as n,TreeGroup as l}from"./chunk-3X2W7R5B.js";import{ImageLightbox as a}from"./chunk-RQBQETXQ.js";import{MarqueeBox as i}from"./chunk-IC72MGON.js";import{Drawer as r}from"./chunk-2NRNKF46.js";import{EmptyState as t}from"./chunk-YQLKZ5UQ.js";import{DescriptionList as o}from"./chunk-SACUSHVN.js";import{Breadcrumbs as d}from"./chunk-IUG4Z2ND.js";import{ROOT_KEY as s,mediaLibraryMenu as c}from"./chunk-R6TDZ7T5.js";import{useMediaMoveItems as u}from"./chunk-UTITWGVW.js";import{MediaUploadGrid as m}from"./chunk-6DQANKTL.js";import{MediaUsedInList as h}from"./chunk-CSLMWGFS.js";import{RenameField as p}from"./chunk-ALJS3SYS.js";import{NativeSelect as f}from"./chunk-ESWR7YNY.js";import{Segmented as g}from"./chunk-JQBVSPF5.js";import{useGridSelection as v}from"./chunk-VLKDWKVR.js";import{useMarquee as k}from"./chunk-OLFYNMTD.js";import{copyToClipboard as y}from"./chunk-JJZAYAVL.js";import{Checkbox_default as b}from"./chunk-CGZBDI6C.js";import{useContextMenu as w,ContextMenu as x}from"./chunk-57WQVUBX.js";import{Banner as N}from"./chunk-IIKPM3F4.js";import{Input_default as C}from"./chunk-LGTYPLJM.js";import{DropdownMenu as I}from"./chunk-GO6HU2O3.js";import{IconButton_default as D}from"./chunk-VCMHBUKI.js";import{useFileIntake as S,FileIntakeAlert as j}from"./chunk-ZKBGUDNB.js";import{ColoredBadge as T}from"./chunk-CT7AU2TA.js";import{Button_default as z}from"./chunk-7DI3VQCF.js";import{buttonClasses as F}from"./chunk-UQYNPYF4.js";import{Icon as L}from"./chunk-7V32O5NF.js";import{Tooltip as O}from"./chunk-QQ2LDC6C.js";import{usePlotWidth as A}from"./chunk-MAFUXCPZ.js";import{useShellStrings as P}from"./chunk-5YP7MFPK.js";import{useRef as M,useMemo as E,useCallback as U,useState as R,useEffect as K}from"react";import{jsxs as B,Fragment as Q,jsx as V}from"react/jsx-runtime";var G="application/x-efficient-media-files",W="application/x-efficient-media-folder",Y="application/x-efficient-media-file";function J(e){if(!e||!Array.from(e.types).includes(Y))return null;try{const n=JSON.parse(e.getData(Y));if(n&&"string"==typeof n.id&&"string"==typeof n.url&&"string"==typeof n.name&&("image"===n.kind||"video"===n.kind))return{id:n.id,url:n.url,kind:n.kind,name:n.name}}catch{}return null}var Z={type:"all",use:"any",sort:"newest"},$={lock:/* @__PURE__ */V(L,{name:"lock","aria-hidden":"true",className:"h-4 w-4"}),folder:/* @__PURE__ */V(L,{name:"folder","aria-hidden":"true",className:"h-4 w-4"}),folderOpen:/* @__PURE__ */V(L,{name:"folder-open","aria-hidden":"true",className:"h-4 w-4"}),folderPlus:/* @__PURE__ */V(L,{name:"folder-plus","aria-hidden":"true",className:"h-4 w-4"}),trash:/* @__PURE__ */V(L,{name:"trash","aria-hidden":"true",className:"h-4 w-4"}),upload:/* @__PURE__ */V(L,{name:"upload","aria-hidden":"true",className:"h-4 w-4"}),search:/* @__PURE__ */V(L,{name:"search","aria-hidden":"true",className:"h-4 w-4"}),grid:/* @__PURE__ */V(L,{name:"grid","aria-hidden":"true",className:"h-4 w-4"}),list:/* @__PURE__ */V(L,{name:"list","aria-hidden":"true",className:"h-4 w-4"}),more:/* @__PURE__ */V(L,{name:"more","aria-hidden":"true",className:"h-4 w-4"}),copy:/* @__PURE__ */V(L,{name:"copy","aria-hidden":"true",className:"h-4 w-4"}),edit:/* @__PURE__ */V(L,{name:"edit","aria-hidden":"true",className:"h-4 w-4"}),swap:/* @__PURE__ */V(L,{name:"swap","aria-hidden":"true",className:"h-4 w-4"}),crop:/* @__PURE__ */V(L,{name:"crop","aria-hidden":"true",className:"h-4 w-4"}),external:/* @__PURE__ */V(L,{name:"external","aria-hidden":"true",className:"h-4 w-4"}),undo:/* @__PURE__ */V(L,{name:"undo","aria-hidden":"true",className:"h-4 w-4"})},H={link:/* @__PURE__ */V(L,{name:"link","aria-hidden":"true",className:"h-3 w-3"}),email:/* @__PURE__ */V(L,{name:"email","aria-hidden":"true",className:"h-3 w-3"}),lock:/* @__PURE__ */V(L,{name:"lock","aria-hidden":"true",className:"h-3 w-3"}),clock:/* @__PURE__ */V(L,{name:"clock","aria-hidden":"true",className:"h-3 w-3"})};function q(L){const{mode:J="manage",layout:q="auto",location:X,onLocationChange:_,folders:ee,products:ne,allFilesCount:le,trashCount:ae,files:ie,query:re,onQueryChange:te,filters:oe=Z,onFiltersChange:de,extraFilters:se,view:ce="grid",onViewChange:ue,selectedIds:me,onSelectionChange:he,usedIn:pe,denied:fe={},accept:ge="image/*,video/*",maxSizeBytes:ve,busy:ke,progress:ye,onUpload:be,onNewFolder:we,onRename:xe,onMove:Ne,onTrash:Ce,onDeleteFolder:Ie,onRestore:De,onDeleteForever:Se,onEmptyTrash:je,onReplace:Te,onCropEdit:ze,onOpenInDesign:Fe,onChoose:Le,onCancel:Oe,pickNote:Ae,onDragOut:Pe,className:Me=""}=L,Ee=P().mediaLibrary,Ue=P().media,Re="pick"===J,Ke=!Re,Be=M(null),Qe=A(Be,"phone"===q?343:1200),Ve="phone"===q||"auto"===q&&Qe<640,Ge=E(()=>function(e=[]){const n=/* @__PURE__ */new Map,l=(e,a)=>{for(const i of e){const e=[...a,i];n.set(i.id,{node:i,path:e}),i.children&&l(i.children,e)}};return l(e,[]),n}(ne),[ne]),We=E(()=>new Map(ee.map(e=>[e.id,e])),[ee]),Ye=E(()=>{const e=/* @__PURE__ */new Map;for(const n of ee){const l=n.parentId&&We.has(n.parentId)?n.parentId:null;e.set(l,[...e.get(l)??[],n])}return e},[ee,We]),Je=U(e=>{const n=[];for(let l=e?We.get(e):void 0;l&&(n.unshift(l),!(n.length>ee.length));l=l.parentId?We.get(l.parentId):void 0);return n},[We,ee.length]),Ze=U((e,n)=>Je(e).some(e=>e.id===n),[Je]),[$e,He]=R(()=>/* @__PURE__ */new Set(["@files"])),qe=e=>He(n=>{const l=new Set(n);return l.has(e)?l.delete(e):l.add(e),l}),Xe=U(e=>{He(n=>e.every(e=>n.has(e))?n:/* @__PURE__ */new Set([...n,...e]))},[]),_e="files"===(en=X).place?`files:${en.folderId??""}`:"products"===en.place?`products:${en.nodeId??""}`:"trash";var en;K(()=>{if("files"===X.place)Xe(["@files",...Je(X.folderId).slice(0,-1).map(e=>e.id)]);else if("products"===X.place){const e=X.nodeId?Ge.get(X.nodeId)?.path??[]:[];Xe(["@products",...e.slice(0,-1).map(e=>`p:${e.id}`)])}},[_e]);const nn="products"===X.place,ln="trash"===X.place,an="files"===X.place,rn=an?X.folderId:null,tn=nn&&X.nodeId?Ge.get(X.nodeId)?.path[0]:void 0,on=e=>e?.sharedFrom?`${Ee.readOnly} ${Ee.editedAtHq(e.sharedFrom)}`:Ee.readOnly,dn=E(()=>ie.map(e=>e.id),[ie]),sn=E(()=>new Map(ie.map(e=>[e.id,e])),[ie]),cn=v(dn),un=E(()=>dn.filter(e=>cn.selected.has(e)),[dn,cn.selected]),mn=1===un.length?sn.get(un[0]):void 0,hn=M(!0);K(()=>{hn.current?hn.current=!1:cn.clear()},[_e]);const pn=me?.join("\0");K(()=>{me&&cn.setSelection(me)},[pn]);const fn=M(pn??""),gn=un.join("\0");K(()=>{fn.current!==gn&&(fn.current=gn,he?.(un))},[gn]);const vn=(e,n={})=>{Re?cn.select(e):cn.select(e,{ctrl:!(!n.ctrlKey&&!n.metaKey),shift:!!n.shiftKey})},[kn,yn]=R(null),bn=e=>{const n=kn;if(yn(null),!n||null==e)return;e!==("folder"===n.kind?We.get(n.id)?.name:sn.get(n.id)?.name)&&xe?.(n,e)},wn=async e=>{if(!we)return;const n=await we(e);Xe(["@files",...e?[e]:[]]),"string"==typeof n&&yn({kind:"folder",id:n})},xn=U(e=>{const n=[],l=n=>{if("files"===e.kind)return n===rn&&an?Ee.alreadyHere:void 0;const l=We.get(e.id);return n===e.id||n&&Ze(n,e.id)?Ee.notIntoItself:(l?.parentId??null)===n?Ee.folderAlreadyHere:void 0};n.push({key:s,label:Ee.allFiles,disabledReason:l(null)});const a=(e,i)=>{for(const r of Ye.get(e)??[])n.push({key:r.id,label:r.name,depth:i,disabledReason:l(r.id)}),a(r.id,i+1)};return a(null,1),n},[Ye,We,an,Ze,rn,Ee]),Nn=U(e=>{const n=new Set(e.map(e=>sn.get(e)?.kind??"image"));return 1===n.size?[...n][0]:"file"},[sn]),[Cn,In]=R(null),Dn={words:Ee,media:Ue,denied:fe,moveTargets:xn,kindOf:Nn,urlOf:e=>sn.get(e)?.url,newSubfolder:we&&Ke?e=>{wn(e)}:void 0,rename:xe&&Ke?e=>{"file"!==e.kind||cn.isSelected(e.id)||cn.select(e.id),yn(e)}:void 0,move:Ne&&Ke?Ne:void 0,trash:Ce&&Ke?Ce:void 0,deleteFolder:Ie&&Ke?Ie:void 0,folderNotEmpty:e=>!!We.get(e)?.notEmpty,replace:Te&&Ke?Te:void 0,copyUrl:e=>{const n=sn.get(e)?.url;n&&y(Ee.urlLabel,n)},openInDesign:Fe,restore:De,deleteForever:Se},Sn=e=>c(e,Dn),jn=w(),Tn=(e,n)=>{Re||(cn.isSelected(e)||cn.select(e),jn.open(n,(e=>{const n=cn.isSelected(e)?un:[e];return nn?{kind:"render",id:e}:ln?{kind:"trashed",ids:n}:{kind:"files",ids:n}})(e)))},[zn,Fn]=R(null),[Ln,On]=R(null),[An,Pn]=R(null);K(()=>{if(!Ln&&!zn)return;const e=()=>{On(null),Fn(null)};return window.addEventListener("dragend",e),window.addEventListener("drop",e),()=>{window.removeEventListener("dragend",e),window.removeEventListener("drop",e)}},[Ln,zn]);const Mn=(e,n)=>Array.from(e.dataTransfer?.types??[]).includes(n),En=(e,n)=>!(!Ne||fe.move||Re)&&(!!Mn(e,G)||!(!Mn(e,W)||!An)&&(n!==An&&!(n&&Ze(n,An)))),Un=(e,n)=>({onDragEnter:l=>{En(l,n)&&(l.preventDefault(),Fn(e))},onDragOver:l=>{En(l,n)&&(l.preventDefault(),l.dataTransfer.dropEffect="move",zn!==e&&Fn(e))},onDragLeave:n=>{const l=n.relatedTarget;l&&n.currentTarget.contains(l)||Fn(n=>n===e?null:n)},onDrop:e=>{if(En(e,n))if(e.preventDefault(),Fn(null),Mn(e,G)){let l;try{l=JSON.parse(e.dataTransfer.getData(G))}catch{l=null}Array.isArray(l)&&l.length&&Ne({kind:"files",ids:l.map(String)},n)}else An&&(Ne({kind:"folder",id:An},n),Pn(null))}}),Rn=e=>{const n=e=>Mn(e,G)||Mn(e,W)||Mn(e,"Files");return{onDragEnter:l=>{n(l)&&On(e)},onDragOver:l=>{n(l)&&Ln!==e&&On(e)},onDragLeave:n=>{const l=n.relatedTarget;l&&n.currentTarget.contains(l)||On(n=>n===e?null:n)}}},Kn=(e,n,l)=>/* @__PURE__ */V(O,{side:"right",content:Ln===e?Ee.noDropProducts:on(l),open:Ln===e||!Ln&&void 0,children:/* @__PURE__ */V("span",{children:n})}),Bn=e=>({onContextMenu:n=>{jn.open(n,e)}}),Qn=(e,a,i)=>e.map(e=>{const r=`p:${e.id}`,t=i??e,o=$e.has(r),d=e.children?.length?e.children:null;/* @__PURE__ */
|
|
2
|
+
return B("div",{role:"none",className:"contents",children:[
|
|
3
|
+
/* @__PURE__ */V(n,{label:Kn(r,e.name,t),level:a,icon:d&&o?$.folderOpen:$.folder,count:e.count,countLabel:null!=e.count?e.countLabel??Ee.fileCount(e.count):void 0,selected:nn&&X.nodeId===e.id,expanded:d?o:void 0,onToggle:d?()=>qe(r):void 0,onSelect:()=>_({place:"products",nodeId:e.id}),rowProps:{"data-media-row":r,...Rn(r),...Ke?Bn({kind:"product-node",id:e.id}):{}}}),d&&o&&/* @__PURE__ */V(l,{children:Qn(d,a+1,t)})]},e.id)}),Vn=(e,a)=>(Ye.get(e)??[]).map(e=>{const i=Ye.get(e.id),r=$e.has(e.id),t="folder"===kn?.kind&&kn.id===e.id,o=Sn({kind:"folder",id:e.id});/* @__PURE__ */
|
|
4
|
+
return B("div",{role:"none",className:"contents",children:[
|
|
5
|
+
/* @__PURE__ */V(n,{label:e.name,level:a,icon:i&&r?$.folderOpen:$.folder,count:e.count,countLabel:null!=e.count?e.countLabel??Ee.fileCount(e.count):void 0,selected:t||an&&X.folderId===e.id,expanded:i?r:void 0,onToggle:i?()=>qe(e.id):void 0,onSelect:()=>_({place:"files",folderId:e.id}),drop:zn===e.id?"into":void 0,dragging:An===e.id,draggable:Ke&&!!Ne&&!fe.move,rename:t?/* @__PURE__ */V(p,{value:e.name,label:Ee.folderName,onDone:bn}):void 0,actions:Ke&&o.length?/* @__PURE__ */V(I,{align:"end","aria-label":Ee.folderActions,trigger:$.more,items:o}):void 0,rowProps:{"data-media-row":e.id,...Un(e.id,e.id),...Ke?Bn({kind:"folder",id:e.id}):{},...Ke&&Ne&&!fe.move?{draggable:!0,onDragStart:n=>{n.dataTransfer.effectAllowed="move",n.dataTransfer.setData(W,e.id),Pn(e.id)},onDragEnd:()=>{Pn(null),Fn(null)}}:{}}}),i&&r&&/* @__PURE__ */V(l,{children:Vn(e.id,a+1)})]},e.id)}),Gn=$e.has("@files"),Wn=$e.has("@products"),Yn=/* @__PURE__ */B(e,{"aria-label":Ee.folders,children:[ne&&/* @__PURE__ */B(Q,{children:[
|
|
6
|
+
/* @__PURE__ */V(n,{label:Kn("@products",Ee.products),level:1,icon:$.lock,badge:{label:Ee.readOnlyBadge,tone:"neutral"},expanded:ne.length?Wn:void 0,onToggle:()=>qe("@products"),selected:nn&&null==X.nodeId,onSelect:()=>_({place:"products",nodeId:null}),rowProps:{"data-media-row":"@products",...Rn("@products")}}),Wn&&ne.length>0&&/* @__PURE__ */V(l,{children:Qn(ne,2)})]}),
|
|
7
|
+
/* @__PURE__ */V(n,{label:Ee.allFiles,level:1,icon:Gn?$.folderOpen:$.folder,count:le,countLabel:null!=le?Ee.fileCount(le):void 0,expanded:Ye.get(null)?.length?Gn:void 0,onToggle:()=>qe("@files"),selected:an&&null==X.folderId,onSelect:()=>_({place:"files",folderId:null}),drop:"@files"===zn?"into":void 0,rowProps:{"data-media-row":"@files",...Un("@files",null)}}),Gn&&(Ye.get(null)?.length??0)>0&&/* @__PURE__ */V(l,{children:Vn(null,2)}),Ke&&/* @__PURE__ */V(n,{label:Ee.trash,level:1,icon:$.trash,count:ae,countLabel:null!=ae?Ee.fileCount(ae):void 0,selected:ln,onSelect:()=>_({place:"trash"}),rowProps:{"data-media-row":"@trash"}})]}),Jn=(()=>{if(ln)return[{label:Ee.trash}];if(nn){const e=X.nodeId?Ge.get(X.nodeId)?.path??[]:[];return[{label:Ee.products,onClick:e.length?()=>_({place:"products",nodeId:null}):void 0},...e.map((n,l)=>({label:n.name,onClick:l<e.length-1?()=>_({place:"products",nodeId:n.id}):void 0}))]}const e=Je(rn);return[{label:Ee.allFiles,onClick:e.length?()=>_({place:"files",folderId:null}):void 0},...e.map((n,l)=>({label:n.name,onClick:l<e.length-1?()=>_({place:"files",folderId:n.id}):void 0}))]})(),Zn=nn?Ee.readOnly:fe.upload,$n=!!be&&!ln&&!Zn,Hn=S({accept:ge,maxSizeBytes:ve,multiple:!0,disabled:!$n,onAccept:e=>be?.(e,rn)}),qn=nn?Ee.noProductFolder:fe.newFolder,Xn=e=>e?{"aria-disabled":!0,disabledReason:e}:{},_n=/* @__PURE__ */B("div",{className:"flex flex-wrap items-center gap-2",children:[Ke&&we&&!ln&&/* @__PURE__ */V(z,{variant:"secondary",size:"sm",leftIcon:$.folderPlus,onClick:()=>{wn(rn)},...Xn(qn),children:Ee.newFolder}),be&&!ln&&/* @__PURE__ */V(z,{variant:"primary",size:"sm",leftIcon:$.upload,onClick:()=>Hn.open(),...Xn(Zn),children:Ee.upload}),Ke&&ln&&je&&ie.length>0&&/* @__PURE__ */V(z,{variant:"danger",size:"sm",onClick:je,...Xn(fe.deleteForever),children:Ee.emptyTrash})]}),el=(e,n,l,a,i)=>/* @__PURE__ */V("div",{style:{width:Ve?void 0:i,flex:Ve?"1 1 120px":"0 0 auto",minWidth:0},children:/* @__PURE__ */V(f,{size:"sm","aria-label":e,value:n,onChange:a,options:l})},e),nl=e=>n=>de?.({...oe,[e]:n}),ll=/* @__PURE__ */B("div",{className:"flex flex-wrap items-center gap-2",children:[te&&/* @__PURE__ */V("div",{style:{flex:"1 1 200px",minWidth:0},children:/* @__PURE__ */V(C,{size:"sm",type:"search",leftIcon:$.search,placeholder:nn?Ee.searchProducts:Ee.search,"aria-label":nn?Ee.searchProducts:Ee.search,value:re??"",onChange:e=>te(e.target.value)})}),de&&el(Ee.mediaType,oe.type,[{value:"all",label:Ee.allTypes},{value:"image",label:Ee.images},{value:"video",label:Ee.videos},{value:"svg",label:"SVG"},{value:"gif",label:"GIF"}],nl("type"),130),de&&!nn&&!ln&&el(Ee.use,oe.use,[{value:"any",label:Ee.anyUse},{value:"email",label:Ee.emailOnly},{value:"website",label:Ee.websiteOnly},{value:"unused",label:Ee.notUsed}],nl("use"),130),de&&Ke&&el(Ee.sort,oe.sort,[{value:"newest",label:Ee.newest},{value:"name",label:Ee.byName},{value:"size",label:Ee.bySize}],nl("sort"),110),se?.map(e=>el(e.label,e.value,e.options,e.onChange,120)),ue&&/* @__PURE__ */V(g,{size:"sm",label:Ee.view,value:ce,onChange:ue,options:[{value:"grid",label:Ee.grid,icon:$.grid},{value:"list",label:Ee.list,icon:$.list}]})]}),al=e=>{const n=[];return null!=e.trashedDaysAgo&&n.push({key:"t",label:Ee.daysAgo(e.trashedDaysAgo),count:e.trashedDaysAgo,icon:H.clock,tone:"neutral"}),e.usedCount&&n.push({key:"u",label:Ee.used(e.usedCount),count:e.usedCount,icon:H.link,tone:"active"}),e.email&&n.push({key:"e",label:Ee.email,icon:H.email,tone:"queued"}),e.private&&n.push({key:"p",label:Ee.private,icon:H.lock,tone:"neutral"}),n},il=e=>al(e).map(e=>/* @__PURE__ */V(T,{tone:e.tone,size:"xs",children:e.label},e.key)),rl=Ke&&an&&!!Ne&&!fe.move,tl=!!Pe&&!ln,ol=e=>!tl||e.private||e.pickDisabledReason?void 0:JSON.stringify({id:e.id,url:e.url,kind:"video"===e.kind?"video":"image",name:e.name}),dl=ie.map(e=>({id:e.id,url:e.thumbUrl??e.url,name:e.name,kind:e.kind,caption:e.name,badges:al(e),dragData:rl?JSON.stringify(cn.isSelected(e.id)?un:[e.id]):ol(e),...rl&&ol(e)?{dragAlso:{[Y]:ol(e)}}:{}})),sl=Ve?Math.max(72,Math.floor((Qe-24-16-1)/3)):112,cl=M(null),ul=k({containerRef:cl,enabled:Ke&&!Ve&&ie.length>0,selected:cn.selected,setSelection:e=>cn.setSelection(e),clearSelection:cn.clear}),ml=e=>{if(Re){const n=sn.get(e);return void(!n||n.private||n.pickDisabledReason||Le?.(n))}const n=dn.indexOf(e);n>=0&&In(n)},hl=ie.length?null:re?/* @__PURE__ */V(t,{variant:"dashed",title:Ee.noMatches}):nn?/* @__PURE__ */V(t,{variant:"dashed",title:Ee.emptyProducts,description:on(tn)}):ln?/* @__PURE__ */V(t,{variant:"dashed",title:Ee.trashEmpty}):!$n||Re?/* @__PURE__ */V(t,{variant:"dashed",title:Ee.emptyFolder}):null,pl="list"===ce&&ie.length>0,fl=hl??(pl?/* @__PURE__ */V("ul",{role:"listbox","aria-multiselectable":Ke||void 0,"aria-label":Ee.folders,className:"flex flex-col gap-1",children:ie.map(e=>/* @__PURE__ */B("li",{role:"option","aria-selected":cn.isSelected(e.id),tabIndex:0,"data-grid-item":"","data-grid-id":e.id,onClick:n=>vn(e.id,n),onDoubleClick:()=>ml(e.id),onContextMenu:n=>Tn(e.id,n),draggable:!!ol(e)||void 0,onDragStart:ol(e)?n=>{n.dataTransfer.effectAllowed="link",n.dataTransfer.setData(Y,ol(e)),Pe("start")}:void 0,onDragEnd:ol(e)?e=>Pe("none"===e.dataTransfer.dropEffect?"cancelled":"dropped"):void 0,onKeyDown:n=>{"Enter"!==n.key&&" "!==n.key||(n.preventDefault(),vn(e.id,n))},className:"flex h-12 cursor-pointer items-center gap-3 rounded-md px-2 text-sm rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)] "+(cn.isSelected(e.id)?"bg-accent-tint text-blue-700":"text-ink hover:bg-gray-100"),children:[
|
|
8
|
+
/* @__PURE__ */V("img",{src:e.thumbUrl??e.url,alt:"",className:"h-10 w-10 shrink-0 rounded bg-gray-100 object-contain"}),
|
|
9
|
+
/* @__PURE__ */V("span",{className:"min-w-0 flex-1 truncate",children:e.name}),
|
|
10
|
+
/* @__PURE__ */V("span",{className:"flex shrink-0 items-center gap-1",children:il(e)}),e.sizeLabel&&/* @__PURE__ */V("span",{className:"w-16 shrink-0 text-right text-xs text-ink-faint",children:e.sizeLabel})]},e.id))}):/* @__PURE__ */V(m,{items:dl,readOnly:!$n||Re,onFiles:$n&&!Re?e=>be(e,rn):void 0,accept:ge,maxSizeBytes:ve,busy:ke,progress:ye,fit:"contain",thumbSize:sl,dragType:rl?G:tl?Y:void 0,onDragOutChange:tl?e=>Pe(e):void 0,selected:cn.selected,onItemClick:vn,onItemDoubleClick:ml,onItemContextMenu:Ke?Tn:void 0,menuOnMedia:Ke})),gl=u({count:un.length,kind:Nn(un),targets:xn({kind:"files",ids:un}),onPick:e=>Ne?.({kind:"files",ids:un},e.key===s?null:e.key)}),vl=F({variant:"secondary",size:"sm"}),kl=/* @__PURE__ */V(I,{align:"start",triggerClassName:vl,trigger:/* @__PURE__ */B(Q,{children:[$.folder,Ee.moveTo]}),items:gl,disabled:!!fe.move}),yl=Ke&&un.length>1&&!nn?/* @__PURE__ */B("div",{"data-media-bulk":"",className:"flex flex-wrap items-center gap-2 rounded-lg border border-line px-3 py-2",children:[
|
|
11
|
+
/* @__PURE__ */V(b,{checked:un.length===ie.length,indeterminate:un.length<ie.length,onChange:e=>e?cn.selectAll():cn.clear(),label:Ee.selected(un.length)}),/* @__PURE__ */B(Q,ln?{children:[De&&/* @__PURE__ */V(z,{variant:"secondary",size:"sm",leftIcon:$.undo,onClick:()=>De(un),...Xn(fe.restore),children:Ee.restore}),Se&&/* @__PURE__ */V(z,{variant:"secondary-danger",size:"sm",onClick:()=>Se(un),...Xn(fe.deleteForever),children:Ee.deleteForever})]}:{children:[Ne&&kl,xe&&/* @__PURE__ */V(z,{variant:"secondary",size:"sm",leftIcon:$.edit,disabled:!0,children:Ee.rename}),Ce&&/* @__PURE__ */V(z,{variant:"secondary",size:"sm",leftIcon:$.trash,onClick:()=>Ce({kind:"files",ids:un}),...Xn(fe.trash),children:Ee.moveFilesToTrash(un.length)})]}),
|
|
12
|
+
/* @__PURE__ */V(z,{variant:"ghost",size:"sm",onClick:cn.clear,children:Ee.clearSelection})]}):null,bl=e=>{const n=[],l=(e,l,a)=>{null!=a&&""!==a&&n.push({key:e,label:l,value:a})},a="file"===kn?.kind&&kn.id===e.id;l("name",Ee.name,a?/* @__PURE__ */V(p,{value:e.name,label:Ee.fileName,onDone:bn}):e.name),l("type",Ee.type,e.typeLabel),l("size",Ee.size,e.sizeLabel),l("resolution",Ee.resolution,e.resolution),nn?(l("design",Ee.design,e.design),l("finish",Ee.finish,e.finish),l("angle",Ee.angleLug,e.angleLug),l("owner",Ee.owner,e.owner)):(l("added",Ee.addedBy,e.addedBy),l("folder",Ee.folder,e.folderPath)),l("used",Ee.usedIn,null!=e.usedCount?Ee.places(e.usedCount):void 0);const i=c({kind:"files",ids:[e.id]},Dn).find(e=>"submenu"===e.type);/* @__PURE__ */
|
|
13
|
+
return B("div",{"data-media-details":"",className:"flex flex-col gap-3",children:[
|
|
14
|
+
/* @__PURE__ */V("img",{src:e.url,alt:e.name,className:"aspect-square w-full rounded-lg bg-gray-100 object-contain"}),nn&&/* @__PURE__ */V(N,{tone:"neutral",title:Ee.readOnlyBadge,children:on(tn)}),
|
|
15
|
+
/* @__PURE__ */V(o,{size:"sm",columns:1,items:n}),!ln&&/* @__PURE__ */B("div",{className:"flex gap-2",children:[
|
|
16
|
+
/* @__PURE__ */V("div",{style:{flex:"1 1 0",minWidth:0},children:/* @__PURE__ */V(C,{size:"sm",readOnly:!0,value:e.url,"aria-label":Ee.fileUrl,onFocus:e=>e.currentTarget.select()})}),
|
|
17
|
+
/* @__PURE__ */V(z,{variant:"secondary",size:"sm",leftIcon:$.copy,onClick:()=>Dn.copyUrl(e.id),children:Ee.copyUrl})]}),an&&Ke&&/* @__PURE__ */B("div",{className:"flex flex-wrap gap-2",children:[Te&&/* @__PURE__ */V(z,{variant:"secondary",size:"sm",leftIcon:$.swap,onClick:()=>Te(e.id),...Xn(fe.replace),children:Ee.replace}),ze&&/* @__PURE__ */V(z,{variant:"secondary",size:"sm",leftIcon:$.crop,onClick:()=>ze(e.id),children:Ee.cropEdit}),Ne&&"submenu"===i?.type&&/* @__PURE__ */V(I,{align:"start",triggerClassName:vl,trigger:/* @__PURE__ */B(Q,{children:[$.folder,Ee.moveTo]}),items:i.items,disabled:!!fe.move}),xe&&/* @__PURE__ */V(z,{variant:"secondary",size:"sm",leftIcon:$.edit,onClick:()=>yn({kind:"file",id:e.id}),...Xn(fe.rename),children:Ee.rename}),Ce&&/* @__PURE__ */V(D,{"aria-label":Ee.moveToTrash,size:"sm",onClick:()=>Ce({kind:"files",ids:[e.id]}),disabledReason:fe.trash,"aria-disabled":!!fe.trash||void 0,children:$.trash})]}),ln&&Ke&&/* @__PURE__ */B("div",{className:"flex flex-wrap gap-2",children:[De&&/* @__PURE__ */V(z,{variant:"primary",size:"sm",leftIcon:$.undo,onClick:()=>De([e.id]),...Xn(fe.restore),children:Ee.restore}),Se&&/* @__PURE__ */V(z,{variant:"danger",size:"sm",onClick:()=>Se([e.id]),...Xn(fe.deleteForever),children:Ee.deleteForever})]}),nn&&Fe&&/* @__PURE__ */V(z,{variant:"secondary",size:"sm",leftIcon:$.external,onClick:()=>Fe({kind:"render",id:e.id}),children:Ee.openInDesign}),pe&&/* @__PURE__ */V(h,{items:pe})]})},wl=mn?mn.private?Ee.privateNoPick:mn.pickDisabledReason:void 0,xl=Re?/* @__PURE__ */B("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__ */V("span",{className:"min-w-0 truncate text-sm text-ink-faint",children:mn?Ee.oneChosen(mn.name):Ee.noneChosen}),
|
|
19
|
+
/* @__PURE__ */B("div",{className:"flex gap-2",children:[Oe&&/* @__PURE__ */V(z,{variant:"secondary",size:"sm",onClick:Oe,children:Ee.cancel}),
|
|
20
|
+
/* @__PURE__ */V(z,{variant:"primary",size:"sm",disabled:!mn,...Xn(wl),onClick:()=>{mn&&!wl&&Le?.(mn)},children:Ee.chooseImage})]})]}):null,Nl=Ke&&!!mn,Cl=/* @__PURE__ */B("div",{className:"flex min-w-0 flex-col gap-3",children:[Ae&&/* @__PURE__ */V(N,{tone:"neutral",children:Ae}),
|
|
21
|
+
/* @__PURE__ */B("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[
|
|
22
|
+
/* @__PURE__ */V(d,{items:Jn}),_n]}),ll,yl,
|
|
23
|
+
/* @__PURE__ */B("div",{ref:cl,className:"relative",onPointerDown:ul.onPointerDown,onKeyDown:e=>{Ke&&(e.ctrlKey||e.metaKey)&&"a"===e.key.toLowerCase()?(e.preventDefault(),cn.selectAll()):"Escape"===e.key&&cn.size&&cn.clear()},children:[fl,
|
|
24
|
+
/* @__PURE__ */V(i,{rect:ul.rect})]}),$n&&/* @__PURE__ */V("input",{...Hn.inputProps}),
|
|
25
|
+
/* @__PURE__ */V(j,{rejections:Hn.rejections})]});/* @__PURE__ */
|
|
26
|
+
return B("div",{ref:Be,"data-media-library":"","data-layout":Ve?"phone":"wide",className:`flex h-full min-h-0 min-w-0 flex-col ${Me}`.trim(),children:[/* @__PURE__ */B("div",Ve?{className:"flex flex-col gap-3 p-3",children:[Yn,Cl]}:{className:"flex min-h-0 min-w-0 flex-1",children:[
|
|
27
|
+
/* @__PURE__ */V("div",{className:"shrink-0 overflow-y-auto border-r border-line p-3",style:{width:280,"--rosh-tree-ground":"var(--surface)"},children:Yn}),
|
|
28
|
+
/* @__PURE__ */V("div",{className:"min-w-0 flex-1 overflow-y-auto p-3",children:Cl}),Nl&&/* @__PURE__ */V("div",{className:"shrink-0 overflow-y-auto border-l border-line p-3",style:{width:300},children:bl(mn)})]}),xl,Ve&&/* @__PURE__ */V(r,{open:Nl,onClose:cn.clear,side:"bottom",title:mn?.name,children:mn&&bl(mn)}),jn.state&&/* @__PURE__ */V(x,{...jn.props,items:Sn(jn.state.data)}),null!=Cn&&ie.length>0&&/* @__PURE__ */V(a,{images:ie.map(e=>({url:e.url,caption:e.name})),startIndex:Math.min(Cn,ie.length-1),onClose:()=>In(null)})]})}export{G as MEDIA_FILES_DRAG_TYPE,Y as MEDIA_FILE_DRAG_TYPE,W as MEDIA_FOLDER_DRAG_TYPE,q as MediaLibrary,J as readMediaFileDrag};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{CartesianPlot as e}from"./chunk-
|
|
1
|
+
import{CartesianPlot as e}from"./chunk-3VR5BOD4.js";import{ChartTooltip as t}from"./chunk-WDQI3FV6.js";import{resolveSeriesColor as i,CHART_INK as l}from"./chunk-TZFACUMR.js";import{useShellStrings as r,useShellLocale as a}from"./chunk-5YP7MFPK.js";import{formatPlain as o}from"./chunk-C3QOHMR6.js";import{jsx as m,jsxs as n}from"react/jsx-runtime";function s({boxes:s,height:c=240,width:h,color:u,tone:x,formatValue:d,yAxisLabel:y,label:k,className:b,emptyLabel:f}){const p=r().charts,q=a(),g=d??(e=>o(e,q)),v=k??p.distribution,W=i(0,u,x),j=s.flatMap(e=>[e.min,e.max,...e.outliers??[]]).filter(Number.isFinite);/* @__PURE__ */
|
|
2
2
|
return m(e,{labels:s.map(e=>e.label),values:j,height:c,width:h,bandPadding:.5,formatValue:g,yAxisLabel:y,className:b,emptyLabel:f,ariaLabel:p.fiveNumber(v,s.length),tooltip:e=>{const i=s[e];/* @__PURE__ */
|
|
3
3
|
return m(t,{title:i.label,rows:[{key:"max",label:p.maximum,color:W,value:g(i.max)},{key:"q3",label:p.q3,color:W,value:g(i.q3)},{key:"median",label:p.median,color:W,value:g(i.median)},{key:"q1",label:p.q1,color:W,value:g(i.q1)},{key:"min",label:p.minimum,color:W,value:g(i.min)}],emphasisKey:"median",footnote:i.outliers?.length?p.outliers(i.outliers.length):void 0})},children:({x:e,y:t,active:i})=>/* @__PURE__ */m("g",{children:s.map((r,a)=>{const o=e.center(a),s=Math.max(6,e.bandwidth);/* @__PURE__ */
|
|
4
4
|
return n("g",{opacity:null!==i&&i!==a?.45:1,children:[
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{MOVE_KEYS as e,MoveHint as r,moveFromKey as t}from"./chunk-
|
|
2
|
-
return d(u.Provider,{value:i,children:/* @__PURE__ */d("div",{...o,role:"list","aria-label":r?void 0:e,"aria-labelledby":r,"data-sortable-list":i,className:`flex min-w-0 flex-col ${"comfortable"===i?"gap-2":"gap-1"} ${a}`.trim(),children:t})})}function b({children:o,title:f,thumb:b,expanded:p,onToggle:h,actions:g,below:v,active:x=!1,flat:w=!1,draggable:y=!1,dragging:N=!1,drop:k,onMove:j,rowProps:
|
|
1
|
+
import{MOVE_KEYS as e,MoveHint as r,moveFromKey as t}from"./chunk-CDQUOCXO.js";import{Icon as i}from"./chunk-7V32O5NF.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:B=""}){const C=x||!!p,O=n(u),$=l(null),A=s(),I=[D?.["aria-describedby"],j?A:void 0].filter(Boolean).join(" ")||void 0,K=D?.tabIndex;a(()=>{const e=$.current;if(!e||void 0!==K)return;const r=[...e.querySelectorAll('a[href], button, input, select, textarea, [contenteditable]:not([contenteditable="false"]), [tabindex]')].some(r=>r!==e);j&&!r?e.tabIndex=0:e.removeAttribute("tabindex")});const T="comfortable"===O?{before:"-top-[5px]",after:"-bottom-[5px]"}:{before:"-top-0.5",after:"-bottom-0.5"},q=null!=f&&/* @__PURE__ */c(m,{children:[null!=b&&/* @__PURE__ */d("span",{"aria-hidden":"true",className:"inline-flex h-6 w-6 shrink-0 overflow-hidden rounded-sm",children:b}),
|
|
3
3
|
/* @__PURE__ */d("span",{"data-list-row-name":"",className:"min-w-0 flex-1 break-words font-semibold text-(--ink-strongest)",children:f})]});/* @__PURE__ */
|
|
4
|
-
return c("div",{role:"listitem","data-list-item":"","data-drop":k,"data-open":
|
|
5
|
-
/* @__PURE__ */c("div",{...
|
|
4
|
+
return c("div",{role:"listitem","data-list-item":"","data-drop":k,"data-open":C||void 0,className:["relative flex min-w-0 flex-col",w?"":"rounded-(--radius-card) border bg-surface transition-colors duration-(--motion-fast)",w?"":C?"border-blue-300":"border-line hover:border-gray-300"].filter(Boolean).join(" "),children:[k&&/* @__PURE__ */d("span",{"aria-hidden":"true","data-list-drop-line":"",className:`pointer-events-none absolute inset-x-2 z-10 h-0.5 rounded-full bg-blue-500 ${T[k]}`}),
|
|
5
|
+
/* @__PURE__ */c("div",{...D,ref:e=>{var r,t;$.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":I,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":"",B].filter(Boolean).join(" "),children:[
|
|
6
6
|
/* @__PURE__ */c("div",{"data-list-row-main":"",className:"flex min-h-8 min-w-0 flex-1 items-center gap-1",children:[q&&(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:[q,
|
|
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:q})),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:
|
|
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:q})),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:A})]}),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};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import{ChartBrush as t}from"./chunk-JRCFOZEU.js";import{ChartDot as e}from"./chunk-CK2YOGUS.js";import{stepPath as a,curvePath as r,areaBetween as o,areaFrom as l}from"./chunk-VFC6QUEN.js";import{ChartDefs as n,MOTION as i,stagger as s,fillFor as c,dashFor as d,maskId as m}from"./chunk-465RRWBY.js";import{ChartSkeleton as h}from"./chunk-5KKJAYKT.js";import{useHighlight as u,highlightOpacity as f}from"./chunk-CNYAHYE6.js";import{useDragZoom as p,DragBand as g,ChartZoomSummary as y,tooltipBesideBand as k}from"./chunk-Y4RHGLXB.js";import{usePlotWidth as x}from"./chunk-MAFUXCPZ.js";import{pairedAxes as v,niceAxis as b,niceMax as M,linearScale as N,axisGutter as w,bandScale as j,ladderScale as $}from"./chunk-2JWPNR2U.js";import{ChartTooltip as V}from"./chunk-WDQI3FV6.js";import{resolveSeriesColor as z,CHART_INK as A,STATUS_VARS as R}from"./chunk-TZFACUMR.js";import{registerModalEscapeInterceptor as L}from"./chunk-TWVUQUUD.js";import{useShellStrings as W,useShellLocale as C}from"./chunk-5YP7MFPK.js";import{formatPercent as E,formatPlain as S}from"./chunk-C3QOHMR6.js";import{useRef as D,useState as T,useId as U,useEffect as P}from"react";import{jsx as F,jsxs as I}from"react/jsx-runtime";var Y=12,K=16,O=26,B=52,Q=t=>"number"==typeof t&&Number.isFinite(t);function H({series:H,labels:J,height:Z=200,stacked:G=!1,stackMode:X="value",levels:q,curve:_="linear",tension:tt=0,max:et,yTickCount:at=4,formatValue:rt,formatTooltipValue:ot,tooltipLabels:lt,yAxisLabel:nt,referenceLines:it,labelEndpoints:st=!1,dots:ct,dotVariant:dt="border",pulse:mt=!1,brush:ht=!1,range:ut,onRangeChange:ft,zoomable:pt=!0,columnStrip:gt,onSelect:yt,loading:kt=!1,animate:xt=!0,reveal:vt="left-to-right",fillVariant:bt="gradient",gridStyle:Mt="solid",width:Nt,className:wt,emptyLabel:jt}){const $t=W().charts,Vt=C(),zt=rt??(t=>S(t,Vt)),At=ot??zt,Rt=jt??$t.noData,Lt=D(null),Wt=x(Lt),Ct=Nt??Wt,[Et,St]=T(null),[Dt,Tt]=T(null),{highlighted:Ut}=u(),Pt=U(),Ft=ut??Dt,It=p(ht&&Ft?Ft[1]-Ft[0]+1:J.length,pt);if(P(()=>{if(null!==Et)return L(t=>"Escape"===t.key&&(St(null),!0))},[Et]),kt)/* @__PURE__ */
|
|
2
|
+
return F("div",{className:wt,ref:Lt,children:/* @__PURE__ */F(h,{height:Z,width:Nt??Wt})});const Yt=J,Kt=ut??Dt??[0,Math.max(0,Yt.length-1)],[Ot,Bt]=Kt,Qt=t=>It.slice(ht?t.slice(Ot,Bt+1):t),Ht=lt?Qt(lt):void 0,Jt=H.map((t,e)=>({...t,slot:e})).filter(t=>t.data.some(Q)).map(t=>({...t,data:Qt(t.data),pointTones:t.pointTones?Qt(t.pointTones):void 0})),Zt=t=>(ht?Ot:0)+(It.view?.[0]??0)+t;if(J=Qt(Yt),0===Jt.length||0===J.length)/* @__PURE__ */
|
|
3
|
+
return F("div",{className:wt,ref:Lt,children:/* @__PURE__ */F("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:Z},children:Rt})});const Gt=J.map((t,e)=>Jt.reduce((t,a)=>t+(Q(a.data[e])?a.data[e]:0),0)),Xt=(t,e)=>Gt[e]>0?t/Gt[e]:null,qt=[];if(G){let t=J.map(()=>0);for(const e of Jt)t=t.map((t,a)=>t+(Q(e.data[a])?e.data[a]:0)),qt.push("percent"===X?t.map((t,e)=>Xt(t,e)):[...t])}const _t=!!q&&q.length>0,te=t=>"right"===t.axis,ee=!G&&!_t&&void 0===et&&Jt.some(te)&&Jt.some(t=>!te(t)),ae=gt&&!G?gt:null,re=t=>!!ae&&"column"===t.mode,oe=(ee?Jt.filter(t=>!te(t)):Jt).filter(t=>!re(t)),le=ee?Jt.filter(te).flatMap(t=>t.data.filter(Q)):[],ne=G?(qt.at(-1)??[]).filter(Q):oe.flatMap(t=>t.data.filter(Q)),ie=ee?v([Math.min(0,...ne),Math.max(0,...ne)],[Math.min(0,...le),Math.max(0,...le)],{intervals:at+1,integerLeft:ne.every(Number.isInteger),integerRight:le.every(Number.isInteger)}):null,se=ie?ie.left:G&&"percent"===X||_t||void 0!==et?null:b(G?0:Math.min(0,...ne),Math.max(0,...ne),{intervals:at+1,integer:ne.every(Number.isInteger)}),ce=se?se.lo:0,de=G&&"percent"===X?1:se?se.hi:et??M(Math.max(...ne,0)),me=G&&"percent"===X?t=>E(Math.round(100*t),0,Vt):zt,he=_t?q:se?se.ticks:N([ce,de],{from:0,to:1}).ticks(at+1),ue=w(he.map(me),B),fe=ie?w(ie.right.ticks.map(zt),K):K,pe={left:ue,right:Math.max(ue+1,Ct-fe),top:Y,bottom:Z-O},ge=j(J.length,{from:pe.left,to:pe.right}),ye=_t?$(q,{from:pe.bottom,to:pe.top}):null,ke=N([ce,de],{from:pe.bottom,to:pe.top}),xe=ke(Math.max(ce,0)),ve=t=>ye?ye(t):ke(t),be=Jt.filter(re),Me=Math.max(0,...J.map((t,e)=>be.reduce((t,a)=>t+Math.max(0,Q(a.data[e])?a.data[e]:0),0))),Ne=t=>xe-(Me>0?t/Me:0)*(pe.bottom-pe.top)*(ae??0),we=ie?N([ie.right.lo,ie.right.hi],{from:pe.bottom,to:pe.top}):null,je=t=>we&&te(t)?we:ve,$e=ye?ye.levels.map(t=>({value:t,y:ye(t)})):he.map(t=>({value:t,y:ke(t)})),Ve=t=>e=>{e.preventDefault(),St(e=>{const a=(e??0)+t;return Math.min(J.length-1,Math.max(0,a))})},ze=Math.max(1,Math.ceil(J.length/Math.max(1,Math.floor(Ct/96))));/* @__PURE__ */
|
|
4
|
+
return I("div",{className:`relative ${wt??""}`,ref:Lt,children:[
|
|
5
|
+
/* @__PURE__ */I("svg",{width:"100%",height:Z,viewBox:`0 0 ${Ct} ${Z}`,role:"img","aria-label":$t.overIntervals(Jt.map(t=>t.label),J.length),tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>St(null),onBlur:()=>St(null),style:pt?{userSelect:"none",touchAction:"pan-y"}:void 0,onKeyDown:t=>{if(yt&&null!==Et&&("Enter"===t.key||" "===t.key))return t.preventDefault(),void yt(Zt(Et));"ArrowRight"===t.key&&Ve(1)(t),"ArrowLeft"===t.key&&Ve(-1)(t)},children:[
|
|
6
|
+
/* @__PURE__ */F("defs",{children:/* @__PURE__ */F("clipPath",{id:Pt,children:/* @__PURE__ */F("rect",{x:pe.left,y:pe.top,width:pe.right-pe.left,height:pe.bottom-pe.top})})}),
|
|
7
|
+
/* @__PURE__ */F(n,{id:Pt,fills:Jt.map((t,e)=>({color:z(t.slot,t.color,t.tone),variant:t.fillVariant??bt})),fadeFrom:G?.42:.3,reveal:!!xt&&vt}),$e.map(t=>/* @__PURE__ */F("line",{x1:pe.left,y1:t.y,x2:pe.right,y2:t.y,stroke:A.grid,strokeWidth:1,shapeRendering:"crispEdges",strokeDasharray:"dashed"===Mt?"3 3":void 0},`grid-${t.value}`)),
|
|
8
|
+
/* @__PURE__ */F("line",{x1:pe.left,y1:xe,x2:pe.right,y2:xe,stroke:A.axis,strokeWidth:1,shapeRendering:"crispEdges"}),$e.map(t=>/* @__PURE__ */F("text",{x:pe.left-8,y:t.y+4,textAnchor:"end","data-axis-tick":"true",fontSize:11,fill:A.label,style:{fontVariantNumeric:"tabular-nums"},children:me(t.value)},`ytick-${t.value}`)),ie&&$e.map((t,e)=>/* @__PURE__ */F("text",{x:pe.right+8,y:t.y+4,textAnchor:"start","data-axis-tick":"true",fontSize:11,fill:A.label,style:{fontVariantNumeric:"tabular-nums"},children:zt(ie.right.ticks[e])},`ytick-r-${t.value}`)),nt&&/* @__PURE__ */F("text",{x:12,y:(pe.top+pe.bottom)/2,transform:`rotate(-90 12 ${(pe.top+pe.bottom)/2})`,textAnchor:"middle",fontSize:11,fill:A.label,children:nt}),
|
|
9
|
+
/* @__PURE__ */F("g",{clipPath:`url(#${Pt})`,mask:xt&&vt?`url(#${m(Pt)})`:void 0,children:Jt.map((t,e)=>{const n=z(t.slot,t.color,t.tone),m=t.mode??(G?"area":"line"),h=f(t.key,Ut);if("step"===m){const e=J.map((e,a)=>({start:ge(a),end:ge.end(a),value:t.data[a]})).filter(t=>Q(t.value)).map(e=>({start:e.start,end:e.end,y:je(t)(e.value)}));/* @__PURE__ */
|
|
10
|
+
return F("path",{d:a(e),fill:"none",stroke:n,strokeWidth:2.5,strokeLinecap:"butt",strokeLinejoin:"miter",opacity:h??void 0,className:"rosh-viz-mark"},t.key)}const u=J.map((a,r)=>{const o=G?qt[e]?.[r]:t.data[r];return Q(o)?[ge.center(r),je(t)(o)]:null}).filter(t=>null!==t);if(0===u.length)return null;if("column"===m){const a=Math.max(1,.62*ge.bandwidth),r="solid"===t.fillVariant,o=je(t);return re(t)?/* @__PURE__ */F("g",{opacity:h??void 0,className:"rosh-viz-mark",children:J.map((o,l)=>{const i=t.data[l];if(!Q(i)||i<=0)return null;const s=((t,e)=>be.slice(0,be.findIndex(e=>e.key===Jt[t]?.key)).reduce((t,a)=>t+Math.max(0,Q(a.data[e])?a.data[e]:0),0))(e,l),c=Ne(s+i),d=Ne(s)-(s>0?1:0);/* @__PURE__ */
|
|
11
|
+
return F("rect",{x:ge.center(l)-a/2,y:c,width:a,height:Math.max(0,d-c),rx:2,fill:t.pointTones?.[l]?R[t.pointTones[l]]:n,fillOpacity:r?1:.55},l)})},t.key):/* @__PURE__ */F("g",{opacity:h??void 0,className:"rosh-viz-mark",children:J.map((l,c)=>{const d=G?qt[e]?.[c]:t.data[c];if(!Q(d))return null;const m=o(d);/* @__PURE__ */
|
|
12
|
+
return F("rect",{x:ge.center(c)-a/2,y:Math.min(m,xe),width:a,height:Math.abs(xe-m),rx:2,fill:n,fillOpacity:r?1:.35,className:xt?i.rise:void 0,style:xt?s(c,26):void 0},c)})},t.key)}const p=r(u,_,tt),g=G&&e>0?J.map((t,a)=>[ge.center(a),ve(qt[e-1]?.[a]??0)-2]):null,y=g?o(p,g):l(p,u,xe);/* @__PURE__ */
|
|
13
|
+
return I("g",{opacity:h??void 0,className:"rosh-viz-mark",children:[("area"===m||G)&&
|
|
14
|
+
/* @__PURE__ */F("path",{d:y,fill:c(Pt,e,t.fillVariant??bt,n),stroke:"none"}),
|
|
15
|
+
/* @__PURE__ */F("path",{d:p,fill:"none",stroke:n,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",strokeDasharray:d(t.stroke??(t.forecast?"animated-dashed":"solid")),className:xt&&("animated-dashed"===t.stroke||t.forecast&&!t.stroke)?i.march:void 0})]},t.key)})}),it?.map((t,e)=>{const a=t.color??R[t.tone??"critical"],r=ve(t.value);/* @__PURE__ */
|
|
16
|
+
return I("g",{children:[
|
|
17
|
+
/* @__PURE__ */F("line",{x1:pe.left,y1:r,x2:pe.right,y2:r,stroke:a,strokeWidth:1,strokeDasharray:"5 4"}),t.label&&/* @__PURE__ */F("text",{x:pe.right-4,y:r-5,textAnchor:"end",fontSize:11,fontWeight:600,fill:a,children:t.label})]},`rule-${e}`)}),"none"!==(ct??(st?"last":"none"))&&Jt.map((t,a)=>{if("column"===t.mode)return null;const r=ct??(st?"last":"none"),o=z(t.slot,t.color,t.tone),l=[...t.data].map(Q).lastIndexOf(!0),n="all"===r?J.map((t,e)=>e).filter(e=>Q(G?qt[a]?.[e]:t.data[e])):l>=0?[l]:[];/* @__PURE__ */
|
|
18
|
+
return I("g",{children:[n.map(r=>{const n=G?qt[a]?.[r]:t.data[r];return Q(n)?/* @__PURE__ */F(e,{cx:ge.center(r),cy:je(t)(n),color:o,variant:dt,pulse:mt&&r===l,title:`${J[r]}: ${t.label} ${zt(n)}`},r):null}),st&&l>=0&&Q(G?qt[a]?.[l]:t.data[l])&&/* @__PURE__ */F("text",{x:ge.center(l)-10,y:je(t)(G?qt[a]?.[l]:t.data[l])-9,textAnchor:"end",fontSize:12,fontWeight:600,fill:A.label,style:{fontVariantNumeric:"tabular-nums"},children:zt(G?qt[a]?.[l]:t.data[l])})]},`dots-${t.key}`)}),J.map((t,e)=>e%ze===0?/* @__PURE__ */F("text",{x:ge.center(e),y:Z-8,textAnchor:"middle",fontSize:11,fill:A.label,style:{fontVariantNumeric:"tabular-nums"},children:t},`xtick-${e}`):null),null!==Et&&/* @__PURE__ */F("line",{x1:ge.center(Et),y1:pe.top,x2:ge.center(Et),y2:pe.bottom,stroke:A.axis,strokeWidth:1}),ae&&Me>0&&
|
|
19
|
+
/* @__PURE__ */I("g",{pointerEvents:"none","data-column-strip":"true",children:[
|
|
20
|
+
/* @__PURE__ */F("line",{x1:pe.left,y1:Ne(Me),x2:pe.right,y2:Ne(Me),stroke:A.grid,strokeWidth:1,strokeDasharray:"2 3",shapeRendering:"crispEdges"}),
|
|
21
|
+
/* @__PURE__ */F("text",{x:pe.left+4,y:Ne(Me)-4,fontSize:11,fill:A.label,style:{fontVariantNumeric:"tabular-nums"},children:zt(Me)})]}),It.drag&&/* @__PURE__ */F(g,{x0:ge(It.drag[0]),x1:ge(It.drag[1])+ge.bandwidth,top:pe.top,bottom:pe.bottom}),J.map((t,e)=>/* @__PURE__ */F("rect",{x:ge(e),y:pe.top,width:Math.max(1,ge.bandwidth),height:pe.bottom-pe.top,fill:"transparent",onMouseEnter:()=>St(e),onPointerDown:()=>It.press(e),onPointerEnter:()=>It.over(e),onPointerUp:It.release,onClick:yt?()=>yt(Zt(e)):void 0,style:yt?{cursor:"pointer"}:void 0},`hit-${e}`))]}),It.view&&/* @__PURE__ */F(y,{from:Ht?.[0]??J[0],to:Ht?.at(-1)??J[J.length-1],count:J.length,total:G&&"percent"!==X?At(Gt.reduce((t,e)=>t+e,0)):ae?At(be.reduce((t,e)=>t+e.data.filter(Q).reduce((t,e)=>t+e,0),0)):void 0,rows:(ae?be:Jt).filter(t=>t.data.some(Q)).map(t=>{const e=t.data.filter(Q),a=z(t.slot,t.color,t.tone);if(0===e.length)return{key:t.key,label:t.label,color:a,value:"—"};const r=e.reduce((t,e)=>t+e,0),o=G||"column"===t.mode?At(r):$t.zoomLevel(At(r/e.length),At(Math.max(...e)));return{key:t.key,label:t.label,color:a,value:o}}),onClear:It.clear}),ht&&Yt.length>2&&/* @__PURE__ */F(t,{className:"mt-1",labels:Yt,width:Ct,data:H[0]?.data??[],range:Kt,onRangeChange:t=>{ft?ft(t):Tt(t)}}),null!==Et&&
|
|
22
|
+
/* @__PURE__ */F("div",{className:"pointer-events-none absolute top-2 z-10",style:k(ge.center(Et),ge.bandwidth,Ct),children:/* @__PURE__ */F(V,{title:Ht?.[Et]??J[Et],rows:Jt.map((t,e)=>({key:t.key,label:t.label,color:z(t.slot,t.color,t.tone),value:Q(t.data[Et])?G&&"percent"===X?`${E(100*(Xt(t.data[Et],Et)??0),1,Vt)} · ${At(t.data[Et])}`:At(t.data[Et]):void 0})),footnote:G&&"percent"===X?$t.inBucket(At(Gt[Et])):void 0})})]})}export{H as TimeSeriesChart};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{SidebarLayout as e}from"./chunk-
|
|
1
|
+
import{SidebarLayout as e}from"./chunk-SGBR443F.js";import{Avatar as t}from"./chunk-SEP35R2E.js";import{Input_default as a}from"./chunk-LGTYPLJM.js";import{Button_default as i}from"./chunk-7DI3VQCF.js";import{useState as s}from"react";import{jsx as n,jsxs as l}from"react/jsx-runtime";var r=[{id:1,name:"Priya Patel",last:"Sounds good — shipping it now",time:"9:41",status:"online"},{id:2,name:"Design team",last:"Marco: updated the tokens",time:"9:12",status:"away"},{id:3,name:"Tom Becker",last:"Thanks!",time:"Yest",status:"offline"},{id:4,name:"Sara Lind",last:"See you Friday 🎉",time:"Yest",status:"busy"}],m=[{mine:!1,text:"Hey! Did the latest build go out?"},{mine:!0,text:"Just merged — deploying now."},{mine:!1,text:"Nice. Any breaking changes for the portal?"},{mine:!0,text:"Nope, fully additive. New components only."},{mine:!1,text:"Sounds good — shipping it now"}];function d(){const[d,o]=s(1),c=r.find(e=>e.id===d)??r[0];/* @__PURE__ */
|
|
2
2
|
return n("div",{className:"h-full",children:/* @__PURE__ */n(e,{side:"left",defaultWidth:260,sidebar:/* @__PURE__ */n("div",{className:"h-full overflow-auto",children:r.map(e=>/* @__PURE__ */l("button",{onClick:()=>o(e.id),className:"flex w-full items-center gap-3 border-b border-gray-100 px-3 py-3 text-left hover:bg-gray-50 "+(e.id===d?"bg-blue-50/50":""),children:[
|
|
3
3
|
/* @__PURE__ */n(t,{name:e.name,status:e.status}),
|
|
4
4
|
/* @__PURE__ */l("div",{className:"min-w-0 flex-1",children:[
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{SidebarLayout as e}from"./chunk-
|
|
1
|
+
import{SidebarLayout as e}from"./chunk-SGBR443F.js";import{Avatar as t}from"./chunk-SEP35R2E.js";import{ItemCount as r}from"./chunk-PDXOGPWH.js";import{Button_default as a}from"./chunk-7DI3VQCF.js";import{useState as i}from"react";import{jsx as l,jsxs as n}from"react/jsx-runtime";var s=[{id:"inbox",label:"Inbox",count:12},{id:"starred",label:"Starred",count:3},{id:"sent",label:"Sent"},{id:"drafts",label:"Drafts",count:1},{id:"archive",label:"Archive"},{id:"trash",label:"Trash"}],d=[{id:1,from:"Marco Reyes",subject:"Q3 roadmap review",preview:"Sharing the deck ahead of Thursday — let me know what you think before the review.",time:"9:14",unread:!0},{id:2,from:"Priya Patel",subject:"Design handoff",preview:"The Figma file is ready for engineering. I exported every icon at 1x and 2x.",time:"8:02",unread:!0},{id:3,from:"GitHub",subject:"[acme/web] PR #482 merged",preview:"Your pull request was merged into main by the release bot after all checks passed.",time:"Yest"},{id:4,from:"Sara Lind",subject:"Lunch Friday?",preview:"A few of us are heading to the new place on 5th at noon if you want to join.",time:"Yest"}];function c(){const[c,o]=i(1),m=d.find(e=>e.id===c)??d[0];/* @__PURE__ */
|
|
2
2
|
return l("div",{className:"h-full",children:/* @__PURE__ */l(e,{side:"left",defaultWidth:200,sidebar:/* @__PURE__ */n("div",{className:"flex h-full flex-col p-2",children:[
|
|
3
3
|
/* @__PURE__ */l(a,{block:!0,className:"mb-2",children:"Compose"}),s.map((e,t)=>/* @__PURE__ */n("button",{className:"flex items-center justify-between rounded-md px-3 py-2 text-left text-sm "+(0===t?"bg-blue-50 font-medium text-blue-700":"text-gray-700 hover:bg-gray-100"),children:[
|
|
4
4
|
/* @__PURE__ */l("span",{children:e.label}),null!=e.count&&/* @__PURE__ */l(r,{count:e.count,active:0===t})]},e.id))]}),children:/* @__PURE__ */n("div",{className:"flex h-full",children:[
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{appendKey as r,backspace as a}from"./chunk-VEPVOHCV.js";import{Button_default as e}from"./chunk-7DI3VQCF.js";import{useShellStrings as n}from"./chunk-
|
|
1
|
+
import{appendKey as r,backspace as a}from"./chunk-VEPVOHCV.js";import{Button_default as e}from"./chunk-7DI3VQCF.js";import{useShellStrings as n}from"./chunk-5YP7MFPK.js";import{jsxs as i,jsx as c}from"react/jsx-runtime";var o=["1","2","3","4","5","6","7","8","9",".","0"];function l({value:l,onChange:s,onEnter:t,enterLabel:m,enterDisabled:d,className:h=""}){const p=n().keypad,u=r=>{r!==l&&s(r)};/* @__PURE__ */
|
|
2
2
|
return i("div",{className:`grid grid-cols-3 gap-3 ${h}`.trim(),children:[o.map(a=>/* @__PURE__ */c(e,{size:"touch-xl",variant:"secondary",onClick:()=>u(r(l,a)),children:a},a)),
|
|
3
3
|
/* @__PURE__ */c(e,{size:"touch-xl",variant:"secondary","aria-label":p.backspace,onClick:()=>u(a(l)),children:"⌫"}),t&&/* @__PURE__ */c(e,{size:"touch-xl",variant:"primary",className:"col-span-3",disabled:d,onClick:t,children:m??p.enter})]})}export{l as NumericKeypad};
|