efficient-shell 9.1.0 → 9.9.1
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 +70 -20
- package/dist/Browser-GQ2ZK4PR.js +43 -0
- package/dist/Calculator-CSYRZAS5.js +29 -0
- package/dist/CurrencyConverter-SSR2XDIC.js +21 -0
- package/dist/{Documents-BOVXZFYC.js → Documents-5AC4WSNK.js} +27 -27
- package/dist/Files-4SD6LLKX.js +88 -0
- package/dist/Notepad-EUIQXFUA.js +25 -0
- package/dist/PdfViewer-XSISAJZP.js +1 -0
- package/dist/{PomodoroTimer-ZCJBTFV5.js → PomodoroTimer-EV6D4OFU.js} +28 -28
- package/dist/Preview-QK5HYJ6U.js +177 -0
- package/dist/Sidebar-Y4DTQYW2.js +43 -0
- package/dist/Spreadsheet-HR6GBICY.js +37 -0
- package/dist/Stock-6ZIQHGPH.js +16 -0
- package/dist/Weather-II7NFRMK.js +60 -0
- package/dist/WorldClock-NBLNO63Q.js +32 -0
- package/dist/ai/index.d.ts +34 -3
- package/dist/ai/index.js +56 -53
- package/dist/ai.css +1 -1
- package/dist/apps/index.js +1 -1
- package/dist/bin/media-host-check.js +1 -1
- package/dist/bin/ui-check.js +1 -1
- package/dist/brand.css +1 -1
- package/dist/charts/BoxPlotChart.js +1 -1
- package/dist/charts/CandlestickChart.js +1 -1
- package/dist/charts/CartesianPlot.js +1 -1
- package/dist/charts/ChartBrush.js +1 -1
- package/dist/charts/ChartFrame.js +1 -1
- package/dist/charts/ChartSkeleton.js +1 -1
- package/dist/charts/ChartTooltip.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-24K6GVNM.js +28 -0
- package/dist/{chunk-ZEKM6HAA.js → chunk-2HEJDLPP.js} +2 -2
- package/dist/{chunk-BRHIRE4D.js → chunk-2MLRK7IO.js} +2 -2
- package/dist/chunk-2R3BVU75.js +26 -0
- package/dist/chunk-2YLG32JY.js +2 -0
- package/dist/{chunk-TZSPJIP4.js → chunk-32VV2J22.js} +1 -1
- package/dist/{chunk-QQCHLRKG.js → chunk-3APSMJPN.js} +1 -1
- package/dist/{chunk-6SMQNPWS.js → chunk-43ONX6UZ.js} +1 -1
- package/dist/{chunk-L7IKTEOC.js → chunk-442FFHQJ.js} +13 -13
- package/dist/chunk-4MVRSCQE.js +1 -0
- package/dist/{chunk-BT3XDH3L.js → chunk-56RAOI7O.js} +6 -6
- package/dist/chunk-5F7HMNCX.js +5 -0
- package/dist/chunk-5GUBNCTP.js +1 -0
- package/dist/{chunk-LGLZTJ2W.js → chunk-5JRL5LXD.js} +6 -6
- package/dist/chunk-5SJ45P5E.js +8 -0
- package/dist/{chunk-OFHCDTJM.js → chunk-5VOVNIOU.js} +1 -1
- package/dist/{chunk-NID6MGGC.js → chunk-5VRMQTKV.js} +8 -8
- package/dist/chunk-6453ISTQ.js +4 -0
- package/dist/{chunk-TFMC2WAS.js → chunk-6JU3WQOR.js} +1 -1
- package/dist/{chunk-MVQBVPWP.js → chunk-6KBDNYRW.js} +1 -1
- package/dist/{chunk-D2AUUIKG.js → chunk-6MVHRNWC.js} +1 -1
- package/dist/{chunk-TW7TA2AB.js → chunk-6ZHX56NM.js} +1 -1
- package/dist/chunk-732XHVR4.js +9 -0
- package/dist/{chunk-RNBM5JZI.js → chunk-7JGR7WPD.js} +4 -4
- package/dist/{chunk-BIJ7ADTZ.js → chunk-7WGOLPGM.js} +1 -1
- package/dist/{chunk-SXSMIMFY.js → chunk-A6RB4PIX.js} +4 -4
- package/dist/{chunk-BMPBVI7P.js → chunk-AGUA3O5O.js} +1 -1
- package/dist/{chunk-UVUBZL7K.js → chunk-ANFLQSGX.js} +5 -5
- package/dist/chunk-ARWMJSQJ.js +3 -0
- package/dist/chunk-AYZY3YNC.js +1 -0
- package/dist/{chunk-BSNWVZHW.js → chunk-B4KMHEFZ.js} +1 -1
- package/dist/chunk-B6YOP2IX.js +6 -0
- package/dist/{chunk-4VLKDANH.js → chunk-BBEOFKLY.js} +1 -1
- package/dist/{chunk-22S6LG6D.js → chunk-BCDG4N6L.js} +1 -1
- package/dist/{chunk-DFDDRKIJ.js → chunk-BCUQXILM.js} +1 -1
- package/dist/{chunk-5TFTSYOD.js → chunk-BVTNGW5S.js} +1 -1
- package/dist/{chunk-TVJRENCQ.js → chunk-BWUU565Y.js} +9 -9
- package/dist/{chunk-SBHFEWR6.js → chunk-C4UL2UNR.js} +1 -1
- package/dist/{chunk-DOCUM3K7.js → chunk-CAG3TSV2.js} +1 -1
- package/dist/chunk-CE5BARZI.js +16 -0
- package/dist/chunk-CJB73MHF.js +2 -0
- package/dist/{chunk-N6DTTOB6.js → chunk-CKPVXDKX.js} +3 -3
- package/dist/chunk-CO5RKOVX.js +20 -0
- package/dist/chunk-CRXFSN5K.js +20 -0
- package/dist/chunk-CVNJSD2J.js +18 -0
- package/dist/{chunk-RYBJ6MMM.js → chunk-CXMTDYVI.js} +1 -1
- package/dist/chunk-D7IXMMZT.js +9 -0
- package/dist/chunk-DNWV6N4P.js +5 -0
- package/dist/{chunk-KZHPX4FM.js → chunk-DWBZ3Z34.js} +2 -2
- package/dist/chunk-DZTAGMNY.js +100 -0
- package/dist/chunk-E4E7MACR.js +20 -0
- package/dist/{chunk-DZNG34DC.js → chunk-EFFF3FCS.js} +23 -23
- package/dist/{chunk-CPK7JTN3.js → chunk-EGAV5LSX.js} +1 -1
- package/dist/{chunk-M5P6A7KS.js → chunk-ENL5L6NR.js} +1 -1
- package/dist/chunk-EW3L4W2I.js +14 -0
- package/dist/{chunk-6GWZ5UPX.js → chunk-EWVOGTEX.js} +1 -1
- package/dist/{chunk-I7HDD4IM.js → chunk-EXNAAHN4.js} +2 -2
- package/dist/{chunk-YDYDR72S.js → chunk-F4DIVARP.js} +1 -1
- package/dist/{chunk-WYN5KVU4.js → chunk-F7F6Z64G.js} +3 -3
- package/dist/{chunk-5PY4H4ZJ.js → chunk-FBUUXK5G.js} +1 -1
- package/dist/chunk-FKNJSD6B.js +14 -0
- package/dist/{chunk-D7FT2PXG.js → chunk-FLEG5KP5.js} +5 -5
- package/dist/{chunk-4OFD6ICH.js → chunk-FLQZ7GQ3.js} +10 -10
- package/dist/{chunk-DXTKNHWG.js → chunk-FPGRKHUW.js} +12 -12
- package/dist/chunk-G4EVQD5U.js +8 -0
- package/dist/chunk-G6CTTBKE.js +9 -0
- package/dist/{chunk-3CST4ZDP.js → chunk-GS5AISRS.js} +4 -4
- package/dist/{chunk-4Y4PWKMM.js → chunk-GVC535IA.js} +3 -3
- package/dist/{chunk-EYX6KLCZ.js → chunk-H7MJM2WI.js} +2 -2
- package/dist/chunk-HJWTWS5E.js +8 -0
- package/dist/{chunk-VH6GB73Q.js → chunk-HL6JSDN3.js} +1 -1
- package/dist/chunk-HNQPF5QZ.js +2 -0
- package/dist/{chunk-WRORJNS5.js → chunk-HQMN5THW.js} +10 -10
- package/dist/chunk-HUF34LSW.js +15 -0
- package/dist/chunk-IB4333CI.js +14 -0
- package/dist/chunk-IGNZULKG.js +17 -0
- package/dist/{chunk-EZULNHQH.js → chunk-IJIESSTX.js} +5 -5
- package/dist/{chunk-S7VSXUKS.js → chunk-IJWFKUYA.js} +4 -4
- package/dist/chunk-IK2WXW2E.js +27 -0
- package/dist/chunk-IMA5SXEC.js +2 -0
- package/dist/{chunk-UZMZ2EDW.js → chunk-IMOPDLMA.js} +1 -1
- package/dist/{chunk-2FLYC6I2.js → chunk-IN4KV3SJ.js} +1 -1
- package/dist/chunk-IPTCV6CQ.js +69 -0
- package/dist/{chunk-ZWAVSUWT.js → chunk-IQWIYZB5.js} +2 -2
- package/dist/chunk-IX6QMUJQ.js +9 -0
- package/dist/{chunk-4G5VLI7E.js → chunk-JDQGHQ2C.js} +1 -1
- package/dist/{chunk-3S3DYAVB.js → chunk-JIW5CJXC.js} +2 -2
- package/dist/{chunk-P42YNSKI.js → chunk-JKDEE35P.js} +1 -1
- package/dist/chunk-JKHWZ2ZY.js +19 -0
- package/dist/{chunk-CKZ6ZDU5.js → chunk-JS6ZSEZJ.js} +1 -1
- package/dist/chunk-K4D63NP3.js +12 -0
- package/dist/chunk-KEK47CP3.js +12 -0
- package/dist/chunk-KWT6GT4M.js +29 -0
- package/dist/{chunk-SR4XAYLC.js → chunk-L67VXJMF.js} +1 -1
- package/dist/chunk-LB3A53D5.js +8 -0
- package/dist/{chunk-D323R2FT.js → chunk-LNARMEEZ.js} +1 -1
- package/dist/{chunk-CZ25A5RS.js → chunk-LNQVTH5S.js} +1 -1
- package/dist/chunk-LUWRPPJA.js +7 -0
- package/dist/chunk-M554OMPA.js +2 -0
- package/dist/{chunk-BVW5U7QQ.js → chunk-M5GMIQ47.js} +3 -3
- package/dist/{chunk-GX2GSDJP.js → chunk-MAMWQCJ6.js} +1 -1
- package/dist/{chunk-ZTB6EMC7.js → chunk-MV6WDGB6.js} +1 -1
- package/dist/chunk-MWIT4UN2.js +14 -0
- package/dist/{chunk-JPRJQ6B7.js → chunk-N3JXHNID.js} +10 -10
- package/dist/{chunk-ZOSIPTXM.js → chunk-N45ACN3G.js} +2 -2
- package/dist/{chunk-EYKUKN32.js → chunk-N7T63BVD.js} +4 -4
- package/dist/chunk-NHH2MXFU.js +2 -0
- package/dist/chunk-NHVXVHUR.js +23 -0
- package/dist/{chunk-J47HXHSL.js → chunk-O5LQBBW2.js} +7 -7
- package/dist/{chunk-IHQX4GYD.js → chunk-OQ2EDMB2.js} +1 -1
- package/dist/chunk-OUSKOWNP.js +12 -0
- package/dist/chunk-OV2SWQPT.js +22 -0
- package/dist/chunk-OX2DOOOI.js +8 -0
- package/dist/{chunk-6KO5VTL7.js → chunk-OZAAIE4E.js} +1 -1
- package/dist/{chunk-Z2YGQBLZ.js → chunk-P3DTYFMC.js} +2 -2
- package/dist/chunk-P3OBE43Q.js +8 -0
- package/dist/{chunk-2UXAI77F.js → chunk-P4XTWAKJ.js} +1 -1
- package/dist/{chunk-7PCI6AUU.js → chunk-PB7G6CJ7.js} +1 -1
- package/dist/chunk-PDB5W7VI.js +6 -0
- package/dist/chunk-PDXPMHG3.js +4 -0
- package/dist/chunk-POCQ7ZL4.js +3 -0
- package/dist/chunk-PVR4KU7H.js +7 -0
- package/dist/{chunk-2RBWQVDC.js → chunk-PYLNMN6E.js} +13 -13
- package/dist/chunk-Q7KTTDUS.js +11 -0
- package/dist/{chunk-3PGK3VFS.js → chunk-QC6OK3ED.js} +1 -1
- package/dist/{chunk-MEJK6PBN.js → chunk-QSJR7EI7.js} +3 -3
- package/dist/chunk-QWHQJNKL.js +1 -0
- package/dist/{chunk-QDLGU62M.js → chunk-QZKWIVZW.js} +1 -1
- package/dist/chunk-R2VKEMZH.js +3 -0
- package/dist/{chunk-EXWGPXOS.js → chunk-RBD7SB6M.js} +1 -1
- package/dist/chunk-RC6UHOAV.js +4 -0
- package/dist/{chunk-VYXDI63I.js → chunk-RDKBMX6U.js} +1 -1
- package/dist/{chunk-45S6M77O.js → chunk-RULVWW4A.js} +6 -6
- package/dist/chunk-RUTUVS4H.js +1 -0
- package/dist/{chunk-MAOJENIB.js → chunk-RWJCKZEY.js} +1 -1
- package/dist/chunk-S4Z657L6.js +6 -0
- package/dist/{chunk-B2XDNBR3.js → chunk-SC63O7AL.js} +1 -1
- package/dist/{chunk-Q3OCGLW7.js → chunk-SOP447EP.js} +2 -2
- package/dist/{chunk-CDRXZBVR.js → chunk-TBPHW42V.js} +1 -1
- package/dist/chunk-TLRCTNUF.js +6 -0
- package/dist/chunk-TNTQL6SX.js +1 -0
- package/dist/chunk-TTHWXGT7.js +11 -0
- package/dist/{chunk-KWX6NAOR.js → chunk-TVL3JPMY.js} +1 -1
- package/dist/chunk-U5N6PSXO.js +9 -0
- package/dist/{chunk-LBLV64XG.js → chunk-UE4PVCA5.js} +2 -2
- package/dist/{chunk-SZIENHKR.js → chunk-UKDJUYIV.js} +1 -1
- package/dist/chunk-UQYNPYF4.js +1 -0
- package/dist/chunk-URHGHXDN.js +1 -0
- package/dist/{chunk-6WWAQC5V.js → chunk-VG2R6PZV.js} +1 -1
- package/dist/{chunk-RWGSMZGS.js → chunk-VVAJ23SD.js} +1 -1
- package/dist/chunk-VVGL5O4F.js +8 -0
- package/dist/chunk-VVJIKS47.js +1 -0
- package/dist/chunk-WE7CYRZT.js +7 -0
- package/dist/{chunk-NGBT7AHL.js → chunk-WH3JHMEA.js} +8 -8
- package/dist/chunk-WUKN5WUM.js +11 -0
- package/dist/{chunk-ET2EF5CI.js → chunk-X7PM7JOD.js} +1 -1
- package/dist/{chunk-4NXMMWL6.js → chunk-XD34TCRG.js} +1 -1
- package/dist/{chunk-Y4MI6NRI.js → chunk-XNWQ72WA.js} +1 -1
- package/dist/{chunk-Y6IQYQYN.js → chunk-XS4HFUTW.js} +2 -2
- package/dist/{chunk-Y5T257HX.js → chunk-XZYAFTW4.js} +4 -4
- package/dist/{chunk-KFJIO5ED.js → chunk-Y44ABEW3.js} +1 -1
- package/dist/chunk-YWGC7J6B.js +11 -0
- package/dist/{chunk-MMFJBWJC.js → chunk-Z3JW77LH.js} +1 -1
- package/dist/chunk-ZAU2HIRH.js +21 -0
- package/dist/{chunk-Y53KNQKL.js → chunk-ZDMZM7HD.js} +2 -2
- package/dist/{chunk-ZCHBOAPA.js → chunk-ZHHEMSOD.js} +2 -2
- package/dist/chunk-ZOHQVSB3.js +27 -0
- package/dist/{chunk-G63BCOQ6.js → chunk-ZTL2RPNY.js} +1 -1
- package/dist/{chunk-U4BMS5EV.js → chunk-ZYDZY6ED.js} +1 -1
- package/dist/data/DataTable.js +1 -1
- package/dist/data/Kanban.js +1 -1
- package/dist/data/ListFooter.js +1 -1
- package/dist/data/ListLoadError.js +1 -1
- package/dist/data/Pagination.js +1 -1
- package/dist/file-intake/index.js +1 -1
- package/dist/forms/AlignmentGrid.js +1 -1
- package/dist/forms/BorderInput.js +1 -1
- package/dist/forms/BrandAssetEditor.js +1 -1
- package/dist/forms/Button.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/FormField.js +1 -1
- package/dist/forms/IconButton.js +1 -1
- package/dist/forms/IconPicker.js +1 -1
- package/dist/forms/ImageFocusPoint.js +1 -1
- package/dist/forms/Input.js +1 -1
- package/dist/forms/InputNumber.js +1 -1
- package/dist/forms/LinkPicker.js +1 -1
- package/dist/forms/MediaLibrary.d.ts +6 -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/PictureTiles.js +1 -1
- package/dist/forms/PositionInput.js +1 -1
- package/dist/forms/RadioGroup.js +1 -1
- package/dist/forms/Segmented.js +1 -1
- package/dist/forms/Select.d.ts +6 -0
- 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/Textarea.js +1 -1
- package/dist/forms/TimePicker.js +1 -1
- package/dist/forms/WidthsBar.d.ts +7 -8
- package/dist/forms/WidthsBar.js +1 -1
- package/dist/forms/buttonStyles.js +1 -1
- package/dist/forms/mediaLibraryMenu.js +1 -1
- package/dist/forms/mediaMoveItems.js +1 -1
- package/dist/forms/styles.d.ts +2 -2
- package/dist/forms/styles.js +1 -1
- package/dist/forms/textAlign.js +1 -1
- package/dist/forms/useFileIntake.js +1 -1
- package/dist/icons/efficient-glyphs.js +1 -1
- package/dist/icons/efficient-looks.js +1 -1
- package/dist/icons/efficient.js +1 -1
- package/dist/icons/glyphs/SpinnerIcon.js +1 -1
- package/dist/icons/looks/map.js +1 -1
- package/dist/icons/sets.js +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +695 -695
- package/dist/locales/zh-Hans.js +1 -1
- package/dist/map/index.js +12 -12
- package/dist/markdown/index.js +5 -5
- package/dist/page-tabs/index.js +5 -5
- package/dist/pdf/index.js +1 -1
- package/dist/shell/Accordion.js +1 -1
- package/dist/shell/AppUpdateBanner.js +1 -1
- package/dist/shell/Avatar.js +1 -1
- package/dist/shell/Banner.js +1 -1
- package/dist/shell/Breadcrumbs.js +1 -1
- package/dist/shell/BudgetBar.js +1 -1
- package/dist/shell/Card.js +1 -1
- package/dist/shell/ColoredBadge.js +1 -1
- package/dist/shell/ConfirmDialog.js +1 -1
- package/dist/shell/ContainerFillChart.js +1 -1
- package/dist/shell/ContextMenu.js +1 -1
- package/dist/shell/CountBadge.js +1 -1
- package/dist/shell/Dialog.js +1 -1
- package/dist/shell/Drawer.js +1 -1
- package/dist/shell/DropdownMenu.js +1 -1
- package/dist/shell/EditableGrid.js +1 -1
- package/dist/shell/EmptyState.js +1 -1
- package/dist/shell/EmptyValue.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.d.ts +20 -0
- package/dist/shell/ItemCount.js +1 -0
- package/dist/shell/Kbd.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/Popover.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.d.ts +19 -5
- package/dist/shell/SidebarNav.js +1 -1
- package/dist/shell/SortableList.js +1 -1
- package/dist/shell/Spinner.js +1 -1
- package/dist/shell/Statistic.js +1 -1
- package/dist/shell/StatusBadge.js +1 -1
- package/dist/shell/StepChain.js +1 -1
- package/dist/shell/Tabs.js +1 -1
- package/dist/shell/TimeAgo.js +1 -1
- package/dist/shell/TimelineTrack.js +1 -1
- package/dist/shell/Tooltip.js +1 -1
- package/dist/shell/TopNav.js +1 -1
- package/dist/shell/TransferProgress.js +1 -1
- package/dist/shell/Tree.d.ts +15 -6
- package/dist/shell/Tree.js +1 -1
- package/dist/shell/language.js +1 -1
- package/dist/shell/strings.d.ts +24 -2
- 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/themes.css +101 -0
- package/dist/tokens/colour.d.ts +42 -0
- package/dist/tokens/colour.js +1 -0
- package/dist/tokens/elevation.d.ts +3 -1
- package/dist/tokens/elevation.js +1 -1
- package/dist/ui/index.d.ts +2 -0
- package/dist/ui/index.js +1 -1
- package/dist/ui.css +266 -24
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/Browser-FTCJCMD3.js +0 -43
- package/dist/Calculator-7O7HXEKH.js +0 -29
- package/dist/CurrencyConverter-IVJJCYZ7.js +0 -21
- package/dist/Files-YWBBU2FZ.js +0 -87
- package/dist/Notepad-KKKCTUB3.js +0 -25
- package/dist/PdfViewer-KJCJ6EPG.js +0 -1
- package/dist/Preview-CHV67AA7.js +0 -177
- package/dist/Sidebar-6I4FC5AK.js +0 -43
- package/dist/Spreadsheet-SNLKLOLL.js +0 -37
- package/dist/Stock-PHY6Z26A.js +0 -16
- package/dist/Weather-YQA5CAFQ.js +0 -60
- package/dist/WorldClock-J6L7FWI2.js +0 -32
- package/dist/chunk-2NMT3Y5H.js +0 -20
- package/dist/chunk-3WC6ITJ3.js +0 -11
- package/dist/chunk-3ZHFKOFX.js +0 -14
- package/dist/chunk-454DAGYG.js +0 -19
- package/dist/chunk-4CANQ3B3.js +0 -1
- package/dist/chunk-4CFOKYVR.js +0 -12
- package/dist/chunk-4IU5BSVE.js +0 -2
- package/dist/chunk-4IVT244O.js +0 -8
- package/dist/chunk-4SZDP3JF.js +0 -12
- package/dist/chunk-63EK6S3W.js +0 -3
- package/dist/chunk-64WSMLXG.js +0 -2
- package/dist/chunk-6BCFVOG7.js +0 -22
- package/dist/chunk-6NMDKOQA.js +0 -7
- package/dist/chunk-7C56GLLI.js +0 -28
- package/dist/chunk-7DKPJUGU.js +0 -2
- package/dist/chunk-7MSFHQAY.js +0 -8
- package/dist/chunk-7OCNF4AI.js +0 -5
- package/dist/chunk-AAW27HJY.js +0 -3
- package/dist/chunk-BI6ZLD4X.js +0 -11
- package/dist/chunk-BIYL7CEI.js +0 -2
- package/dist/chunk-BOBUSE33.js +0 -2
- package/dist/chunk-BUGAWNOC.js +0 -14
- package/dist/chunk-CRLSG5AY.js +0 -9
- package/dist/chunk-DITCVBR7.js +0 -15
- package/dist/chunk-DODH46ZQ.js +0 -8
- package/dist/chunk-E5ALJIXV.js +0 -9
- package/dist/chunk-E6UCGCOC.js +0 -1
- package/dist/chunk-EGDJEY4K.js +0 -27
- package/dist/chunk-EL2RLUT6.js +0 -20
- package/dist/chunk-ET32NQHX.js +0 -2
- package/dist/chunk-EZ3BQ6PK.js +0 -18
- package/dist/chunk-FRPNTDP4.js +0 -8
- package/dist/chunk-GATKJSGL.js +0 -8
- package/dist/chunk-GNPTNAZH.js +0 -4
- package/dist/chunk-JPP7UWQA.js +0 -4
- package/dist/chunk-K7KQDPLW.js +0 -27
- package/dist/chunk-K7U4RWXJ.js +0 -1
- package/dist/chunk-KJY57QPT.js +0 -100
- package/dist/chunk-LGAN7DNC.js +0 -9
- package/dist/chunk-MEYYQC43.js +0 -8
- package/dist/chunk-MVP6Q6KV.js +0 -1
- package/dist/chunk-NDO24PK6.js +0 -21
- package/dist/chunk-OSA24YH6.js +0 -19
- package/dist/chunk-P5BOTIJU.js +0 -6
- package/dist/chunk-PCQPV6MS.js +0 -6
- package/dist/chunk-PF3ANJFI.js +0 -1
- package/dist/chunk-PXEEDRPW.js +0 -14
- package/dist/chunk-Q23EHOXW.js +0 -17
- package/dist/chunk-Q5MD3VY6.js +0 -3
- package/dist/chunk-QR4RM7PO.js +0 -1
- package/dist/chunk-REVC6YPT.js +0 -7
- package/dist/chunk-RSO67DWS.js +0 -8
- package/dist/chunk-S2OIRC5H.js +0 -12
- package/dist/chunk-SB7OTZI4.js +0 -69
- package/dist/chunk-SRKSGUGT.js +0 -23
- package/dist/chunk-SURSVJA2.js +0 -6
- package/dist/chunk-TH6EAYMO.js +0 -29
- package/dist/chunk-TIQKDAON.js +0 -11
- package/dist/chunk-TVDVVPTN.js +0 -1
- package/dist/chunk-VU6VPKM3.js +0 -11
- package/dist/chunk-W5M6P4DZ.js +0 -8
- package/dist/chunk-X6PPP6NX.js +0 -14
- package/dist/chunk-XLD53X4P.js +0 -9
- package/dist/chunk-XSPDPN5O.js +0 -26
- package/dist/chunk-Y37PBT4H.js +0 -9
- package/dist/chunk-YAEUF3GP.js +0 -1
- package/dist/chunk-YALPQIBR.js +0 -7
- package/dist/chunk-ZK2SULCA.js +0 -16
- package/dist/chunk-ZSFUNXRD.js +0 -5
- /package/dist/{chunk-KJRYEKQP.js → chunk-DSIDJYH7.js} +0 -0
package/dist/chunk-PXEEDRPW.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import{SearchableSelect as e}from"./chunk-4SZDP3JF.js";import{labelClasses as a}from"./chunk-EQKUFYX6.js";import{Select_default as l}from"./chunk-454DAGYG.js";import{isSafeLinkHref as t}from"./chunk-PJPK2ADX.js";import{Input_default as r}from"./chunk-GX2GSDJP.js";import{INPUT_SIZES as n}from"./chunk-PF3ANJFI.js";import{Button_default as i}from"./chunk-4IU5BSVE.js";import{Icon as o}from"./chunk-FSPFV4MI.js";import{registerModalEscapeInterceptor as s}from"./chunk-TWVUQUUD.js";import{useShellStrings as u}from"./chunk-E6UCGCOC.js";import{useId as d,useRef as c,useState as p,useEffect as m}from"react";import{jsx as f,jsxs as v,Fragment as g}from"react/jsx-runtime";function h(e){return"select"===e.type?e.options:"groups"===e.type?e.groups.flatMap(e=>e.options):[]}var b="address",x={kindOf:()=>b,targetOf:e=>e,readFilter:()=>null,withFilter:e=>e},y=e=>t(e.trim());function k(t){const{value:n,kinds:o,rules:k=x,filtersFor:w,label:C,readOnly:N,placeholder:F,className:j=""}=t,O=void 0!==t.onApply,P=u().link,$=k.isSafe??y,D=d(),E=c(null),z=c(null),[A,S]=p({url:n}),U=O?A.url:n,[G,J]=p(!1),[I,K]=p(null),[M,T]=p(null),V=c(()=>{});V.current=O?t.onCancel:()=>{},m(()=>{if(O)return s(e=>{const a=E.current;return!!("Escape"===e.key&&a&&e.target instanceof Node&&a.contains(e.target))&&(V.current(),!0)},()=>E.current)},[O]),m(()=>{if(!O)return;const e=z.current;e?(e.focus(),e.select()):E.current?.querySelector("button, input")?.focus()},[]);const W=o??[{value:b,label:P.address,target:{type:"text"}}],X=I&&I.against===U?I.kind:k.kindOf(U),L=W.filter(e=>!e.hideWhenEmpty||h(e.target).length>0||e.value===X),Q=L.find(e=>"text"===e.target.type),R=L.find(e=>e.value===X)??Q??L[0];if(!R)return null;const Y="text"!==R.target.type,q=Y?k.targetOf(U):U,B=h(R.target),H=B.find(e=>e.value===q),Z=e=>({value:e,label:P.unavailable(e)}),_="select"===R.target.type&&q&&w?w(q):null,ee=_?k.readFilter(U):null,ae=ee?_?.find(e=>e.param===ee.param):void 0,le=M&&M.against===U?M.text:U,te=!Y&&""!==le.trim()&&!$(le),re=te&&(!O||G),ne=(e,a)=>{O?S({url:e,name:a}):void 0===a?t.onChange(e):t.onChange(e,a)},ie=(e,a)=>{K(a=>a?{...a,against:e}:a),ne(e,a)},oe=e=>{if(!e)return ie("");const a=B.find(a=>a.value===e);ie(e,a?.label)},se=Y?U:le.trim(),ue=()=>{if(!O||!se)return;if(!Y&&te)return void J(!0);const e=Y&&A.url===se?A.name:void 0,a=t.onApply;void 0===e?a(se):a(se,e)},de=(e,a)=>a&&!e.some(e=>e.value===a)?[Z(a),...e]:[...e],ce=(a,t,r,n,i)=>{const o=[];for(const e of r){const a=o[o.length-1],l={value:e.value,label:e.label};e.group?a&&"options"in a&&a.label===e.group?a.options.push(l):o.push({label:e.group,options:[l]}):o.push(l)}if(i){const l=r.some(e=>""===e.value);/* @__PURE__ */
|
|
2
|
-
return f(e,{"aria-label":a,value:t,options:o,disabled:N,clearable:l,placeholder:r.find(e=>""===e.value)?.label,onChange:n})}/* @__PURE__ */
|
|
3
|
-
return f(l,{size:"sm","aria-label":a,value:t,options:o,readOnly:N,onChange:n})};let pe;if("text"===R.target.type)pe=/* @__PURE__ */f(r,{ref:z,id:`${D}-address`,size:"sm",type:"text",invalid:re,"aria-label":P.address,"aria-describedby":re?`${D}-why`:void 0,placeholder:F??P.addressPlaceholder,spellCheck:!1,autoComplete:"off",value:le,readOnly:N,onChange:e=>(e=>{J(!1);const a=e.trim();a?$(e)?(T({text:e,against:a}),ie(a)):T({text:e,against:U}):(T({text:e,against:""}),ie(""))})(e.target.value)});else{const e="groups"===R.target.type?R.target.groups.flatMap(e=>e.options.map(a=>({value:a.value,label:a.label,group:e.label}))):R.target.options.map(e=>({value:e.value,label:e.label})),a=[{value:"",label:R.target.placeholder},...de(e,q)];pe=ce(R.label,q,a,oe,e.length>10)}const me=/* @__PURE__ */v(g,{children:[o&&ce(P.linkType,R.value,L.map(e=>({value:e.value,label:e.label})),e=>{T(null),J(!1);const a=L.find(a=>a.value===e);if(!a||"text"===a.target.type)return void K({kind:e,against:U});const l=h(a.target)[0];K({kind:e,against:l?l.value:""}),l?ne(l.value,l.label):ne("")},!1),pe,_&&ce(P.filter,ee?.param??"",[{value:"",label:P.noFilter},...ee&&!ae?[Z(ee.param)]:[],..._.map(e=>({value:e.param,label:e.label}))],e=>{if(!e)return ie(q,H?.label);const a=_?.find(a=>a.param===e),l=a?.values[0];l&&ie(k.withFilter(q,{param:e,value:l.value}),l.label)},!1),_&&ee&&ce(P.value,ee.value,de((ae?.values??[]).map(e=>({value:e.value,label:e.label})),ee.value),e=>{if(!ee)return;const a=ae?.values.find(a=>a.value===e);ie(k.withFilter(q,{param:ee.param,value:e}),a?.label)},(ae?.values.length??0)>10),re&&/* @__PURE__ */f("p",{id:`${D}-why`,role:"alert",className:"text-2xs leading-4 text-red-600",children:P.unsafe}),R.hint&&/* @__PURE__ */f("p",{className:"text-2xs leading-4 text-gray-400",children:R.hint}),_&&/* @__PURE__ */f("p",{className:"text-2xs leading-4 text-gray-400",children:P.filterHint})]});if(!O)/* @__PURE__ */
|
|
4
|
-
return f("div",{ref:E,className:`flex min-w-0 flex-auto flex-col gap-2 ${j}`.trim(),role:C?"group":void 0,"aria-label":C,children:me});const fe=t.onRemove;/* @__PURE__ */
|
|
5
|
-
return v("div",{ref:E,role:"dialog","aria-label":C??P.title,className:`flex min-w-0 flex-col gap-2 rounded-xl border border-gray-200 bg-white p-3 shadow-lg ${j}`.trim(),onKeyDown:e=>{"Enter"!==e.key||e.defaultPrevented||e.target instanceof Element&&e.target.closest("button")||(e.preventDefault(),ue())},children:[Y?/* @__PURE__ */f("span",{className:a({inline:!0}),children:P.title}):/* @__PURE__ */f("label",{htmlFor:`${D}-address`,className:a({inline:!0}),children:P.title}),me,
|
|
6
|
-
/* @__PURE__ */v("div",{className:"flex items-center justify-between gap-2",children:[fe?/* @__PURE__ */f(i,{variant:"ghost-danger",size:"sm","data-window-action":"remove",onClick:fe,children:P.remove}):null,
|
|
7
|
-
/* @__PURE__ */v("span",{className:"ml-auto flex gap-1",children:[
|
|
8
|
-
/* @__PURE__ */f(i,{variant:"secondary",size:"sm","data-window-action":"cancel",onClick:()=>V.current(),children:P.cancel}),
|
|
9
|
-
/* @__PURE__ */f(i,{variant:"primary",size:"sm","data-window-action":"apply",onClick:ue,disabled:N||""===se,children:P.apply})]})]})]})}function w({label:e,text:a,onTextChange:l,link:t,onLinkChange:i,kinds:s,rules:m,filtersFor:g,textPlaceholder:h,readOnly:b,className:x=""}){const y=u().link,[w,C]=p(!1),N=c(null),F=d(),j=()=>{C(!1),N.current?.focus()};/* @__PURE__ */
|
|
10
|
-
return v("div",{className:`flex min-w-0 flex-auto flex-col ${x}`.trim(),children:[
|
|
11
|
-
/* @__PURE__ */f(r,{size:"md",type:"text",className:"rounded-b-none","aria-label":y.text(e),placeholder:h,value:a,readOnly:b,onChange:e=>l(e.target.value)}),
|
|
12
|
-
/* @__PURE__ */v("button",{ref:N,type:"button","aria-label":y.linkOf(e,t),"aria-expanded":w,"aria-controls":w?F:void 0,disabled:b,onClick:()=>C(e=>!e),className:`flex w-full min-w-0 items-center gap-2 rounded-b-(--radius-control) border border-t-0 border-gray-300 bg-gray-50 ${n.md} text-left hover:bg-gray-100 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring)] disabled:cursor-not-allowed disabled:opacity-60`,children:[
|
|
13
|
-
/* @__PURE__ */f(o,{name:"link",strokeWidth:1.5,className:"h-4 w-4 shrink-0 "+(t?"text-blue-600":"text-gray-400")}),
|
|
14
|
-
/* @__PURE__ */f("span",{className:"min-w-0 truncate "+(t?"text-blue-600":"text-gray-400"),children:t||y.addLink})]}),w&&/* @__PURE__ */f("div",{id:F,className:"mt-2",children:/* @__PURE__ */f(k,{value:t,label:y.linkOf(e,t),kinds:s,rules:m,filtersFor:g,onApply:(e,a)=>{void 0===a?i(e):i(e,a),j()},onRemove:t?()=>{i(""),j()}:void 0,onCancel:j})})]})}export{k as LinkPicker,w as TextLinkField};
|
package/dist/chunk-Q23EHOXW.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import{SidebarLayout as e}from"./chunk-LGLZTJ2W.js";import{Avatar as t}from"./chunk-MMFJBWJC.js";import{Input_default as a}from"./chunk-GX2GSDJP.js";import{Button_default as i}from"./chunk-4IU5BSVE.js";import{useState as s}from"react";import{jsx as l,jsxs as n}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
|
-
return l("div",{className:"h-full",children:/* @__PURE__ */l(e,{side:"left",defaultWidth:260,sidebar:/* @__PURE__ */l("div",{className:"h-full overflow-auto",children:r.map(e=>/* @__PURE__ */n("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
|
-
/* @__PURE__ */l(t,{name:e.name,status:e.status}),
|
|
4
|
-
/* @__PURE__ */n("div",{className:"min-w-0 flex-1",children:[
|
|
5
|
-
/* @__PURE__ */n("div",{className:"flex items-center justify-between gap-2",children:[
|
|
6
|
-
/* @__PURE__ */l("span",{className:"truncate text-sm font-medium text-gray-900",children:e.name}),
|
|
7
|
-
/* @__PURE__ */l("span",{className:"shrink-0 text-2xs text-gray-400",children:e.time})]}),
|
|
8
|
-
/* @__PURE__ */l("div",{className:"truncate text-xs text-gray-500",children:e.last})]})]},e.id))}),children:/* @__PURE__ */n("div",{className:"flex h-full flex-col",children:[
|
|
9
|
-
/* @__PURE__ */n("div",{className:"flex items-center gap-3 border-b border-gray-200 p-3",children:[
|
|
10
|
-
/* @__PURE__ */l(t,{name:c.name,status:c.status,size:"sm"}),
|
|
11
|
-
/* @__PURE__ */n("div",{children:[
|
|
12
|
-
/* @__PURE__ */l("div",{className:"text-sm font-medium text-gray-900",children:c.name}),
|
|
13
|
-
/* @__PURE__ */l("div",{className:"text-xs text-gray-400 capitalize",children:c.status})]})]}),
|
|
14
|
-
/* @__PURE__ */l("div",{className:"flex flex-1 flex-col gap-2 overflow-auto bg-gray-50 p-4",children:m.map((e,t)=>/* @__PURE__ */l("div",{className:"flex "+(e.mine?"justify-end":"justify-start"),children:/* @__PURE__ */l("div",{style:{maxWidth:"75%"},className:"rounded-2xl px-3 py-2 text-sm "+(e.mine?"bg-blue-600 text-white":"bg-white text-gray-800 shadow-sm"),children:e.text})},t))}),
|
|
15
|
-
/* @__PURE__ */n("form",{className:"flex items-center gap-2 border-t border-gray-200 p-3",onSubmit:e=>e.preventDefault(),children:[
|
|
16
|
-
/* @__PURE__ */l("div",{className:"flex-1",children:/* @__PURE__ */l(a,{placeholder:"Type a message…"})}),
|
|
17
|
-
/* @__PURE__ */l(i,{type:"submit",children:"Send"})]})]})})})}export{d as ChatTemplate};
|
package/dist/chunk-Q5MD3VY6.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{SPINNER_RING as e,SPINNER_TEXT_SIZE as s,SPINNER_INK as t}from"./chunk-MRJKZWWV.js";import{jsx as a,jsxs as r}from"react/jsx-runtime";function n({className:r=s,ink:n=t,style:l}){/* @__PURE__ */
|
|
2
|
-
return a("span",{"aria-hidden":"true",style:l,className:`${e} ${r} ${n}`.replace(/\s+/g," ").trim()})}function l({size:e="md",padding:s="py-12",label:t,className:l=""}){const c=e=>/* @__PURE__ */a(n,{className:e});return null==t?/* @__PURE__ */a("div",{className:`flex items-center justify-center ${s} ${l}`,children:c("sm"===e?"h-5 w-5":"lg"===e?"h-12 w-12":"h-8 w-8")}):/* @__PURE__ */r("div",{role:"status",className:`flex items-center justify-center gap-2 ${s} ${l}`,children:[c("h-4 w-4"),
|
|
3
|
-
/* @__PURE__ */a("span",{className:"text-sm text-gray-500",children:t})]})}export{l as LoadingSpinner,n as SpinnerRing};
|
package/dist/chunk-QR4RM7PO.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function t(t=!1){return`mt-0.5 block truncate ${t?"text-2xs leading-4":"text-xs leading-4"} font-normal text-gray-500`}export{t as optionNoteClass};
|
package/dist/chunk-REVC6YPT.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{writeClipboard as e}from"./chunk-5PY4H4ZJ.js";import{IconButton_default as r}from"./chunk-4CANQ3B3.js";import{toast_default as t}from"./chunk-4NXMMWL6.js";import{Icon as n}from"./chunk-FSPFV4MI.js";import{useShellStrings as a}from"./chunk-E6UCGCOC.js";import{useState as i,useRef as o,useEffect as c,useCallback as l}from"react";import{jsxs as m,jsx as s,Fragment as d}from"react/jsx-runtime";var u={bordered:"border border-gray-300 bg-white",flat:"bg-gray-100"},p={sm:{box:"gap-2 px-3 py-1 text-xs",button:"-my-1"},md:{box:"gap-2 px-3 min-h-8 py-1 text-sm",button:"-my-0.5"}};function b(){/* @__PURE__ */
|
|
2
|
-
return s(n,{name:"copy",className:"h-4 w-4","aria-hidden":"true"})}function h(){/* @__PURE__ */
|
|
3
|
-
return s(n,{name:"check",className:"h-4 w-4 text-green-600","aria-hidden":"true"})}function y({value:n,children:y,symbol:f,label:x,size:g="md",variant:N="bordered",hideCopyButton:k=!1,onCopy:v,multiline:w=!1,id:j,"aria-describedby":C,className:B=""}){const[M,T]=i(!1),F=o(null),L=a().copy;c(()=>()=>{F.current&&clearTimeout(F.current)},[]);const P=l(async()=>{await e(n)?(T(!0),F.current&&clearTimeout(F.current),F.current=setTimeout(()=>{T(!1),F.current=null},2e3),v?.(n)):t.error(L.failed)},[n,v,L]),{box:z,button:A}=p[g],E=!k;/* @__PURE__ */
|
|
4
|
-
return m("div",{id:E?void 0:j,"aria-describedby":E?void 0:C,className:["inline-flex max-w-full items-center rounded-md",u[N],z,B].filter(Boolean).join(" "),children:[null!=f&&""!==f&&/* @__PURE__ */s("span",{"aria-hidden":"true",className:"shrink-0 select-none font-mono text-gray-400",children:f}),
|
|
5
|
-
/* @__PURE__ */s("span",{className:"min-w-0 font-mono text-gray-800 "+(w?"whitespace-pre-wrap break-all":"truncate"),title:w?void 0:n,children:y??n}),!k&&/* @__PURE__ */m(d,{children:[
|
|
6
|
-
/* @__PURE__ */s(r,{id:j,"aria-label":x?L.copyLabel(x):L.copy,"aria-describedby":C,onClick:P,className:`${A} text-gray-400`,children:/* @__PURE__ */s(M?h:b,{})}),
|
|
7
|
-
/* @__PURE__ */s("span",{"aria-live":"polite",className:"sr-only",children:M?L.copied:""})]})]})}export{y as Snippet};
|
package/dist/chunk-RSO67DWS.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{tooltipBesideBand as t}from"./chunk-MG7A3R75.js";import{niceAxis as e,niceMax as i,linearScale as r,axisGutter as n,bandScale as l}from"./chunk-2JWPNR2U.js";import{usePlotWidth as o}from"./chunk-MAFUXCPZ.js";import{registerModalEscapeInterceptor as a}from"./chunk-TWVUQUUD.js";import{CHART_INK as h}from"./chunk-TZFACUMR.js";import{useShellStrings as s,useShellLocale as c}from"./chunk-E6UCGCOC.js";import{formatPlain as m}from"./chunk-C3QOHMR6.js";import{useRef as d,useState as u,useId as f,useEffect as x}from"react";import{jsx as g,jsxs as p}from"react/jsx-runtime";function y({labels:y,values:v,height:b=220,width:k,bandPadding:M=.24,min:w,max:N,yTickCount:A=4,formatValue:$,yAxisLabel:j,xTickAnchor:C="center",children:R,overlay:E,tooltip:U,onSelect:z,ariaLabel:D,className:L,emptyLabel:P}){const F=s().charts,I=c(),S=$??(t=>m(t,I)),T=P??F.noData,V=d(null),W=o(V),B=k??W,[G,O]=u(null),Q=f();if(x(()=>{if(null!==G)return a(t=>"Escape"===t.key&&(O(null),!0))},[G]),0===y.length||!v.some(Number.isFinite))/* @__PURE__ */
|
|
2
|
-
return g("div",{className:L,ref:V,children:/* @__PURE__ */g("p",{className:"flex items-center justify-center text-sm text-gray-500",style:{height:b},children:T})});const Z=v.filter(Number.isFinite),H=Z.every(Number.isInteger),J=void 0===w&&void 0===N?e(Math.min(0,...Z),Math.max(0,...Z),{intervals:A+1,integer:H}):null,K=void 0!==w&&void 0===N?e(w,Math.max(w,...Z),{intervals:A+1,integer:H,zero:!1}):null,X=J?J.lo:w??Math.min(0,...Z),q=J?J.hi:K?K.hi:N??i(Math.max(...Z,0)),Y=J?J.ticks:K?[X,...K.ticks.filter(t=>t>X)]:r([X,q],{from:0,to:1}).ticks(A+1),_={top:12,right:16,bottom:26,left:n(Y.map(S),48)+(j?10:0)},tt=_.left,et=Math.max(tt+1,B-_.right),it=_.top,rt=b-_.bottom,nt=r([X,q],{from:rt,to:it}),lt=l(y.length,{from:tt,to:et},M),ot=(et-tt)/Math.max(1,y.length),at=ot>=48,ht=at?1:Math.max(1,Math.ceil(y.length/Math.max(1,Math.floor(B/84)))),st=Math.max(2,Math.floor((ot-6)/6.6)),ct=t=>at&&t.length>st?`${t.slice(0,st-1).trimEnd()}…`:t;/* @__PURE__ */
|
|
3
|
-
return p("div",{className:`relative ${L??""}`,ref:V,children:[
|
|
4
|
-
/* @__PURE__ */p("svg",{width:"100%",height:b,viewBox:`0 0 ${B} ${b}`,role:"img","aria-label":D,tabIndex:0,className:"rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-deep)]",onMouseLeave:()=>O(null),onBlur:()=>O(null),onKeyDown:t=>{if(z&&null!==G&&("Enter"===t.key||" "===t.key))return t.preventDefault(),void z(G);if("ArrowRight"!==t.key&&"ArrowLeft"!==t.key)return;t.preventDefault();const e="ArrowRight"===t.key?1:-1;O(t=>Math.min(y.length-1,Math.max(0,(t??0)+e)))},children:[
|
|
5
|
-
/* @__PURE__ */g("defs",{children:/* @__PURE__ */g("clipPath",{id:Q,children:/* @__PURE__ */g("rect",{x:tt,y:it,width:et-tt,height:rt-it})})}),Y.map(t=>/* @__PURE__ */g("line",{x1:tt,y1:nt(t),x2:et,y2:nt(t),stroke:h.grid,strokeWidth:1,shapeRendering:"crispEdges"},`g${t}`)),
|
|
6
|
-
/* @__PURE__ */g("line",{x1:tt,y1:nt(Math.max(X,0)),x2:et,y2:nt(Math.max(X,0)),stroke:h.axis,strokeWidth:1,shapeRendering:"crispEdges"}),Y.map(t=>/* @__PURE__ */g("text",{x:tt-8,y:nt(t)+4,textAnchor:"end",fontSize:11,fill:h.label,style:{fontVariantNumeric:"tabular-nums"},children:S(t)},`t${t}`)),j&&/* @__PURE__ */g("text",{x:14,y:(it+rt)/2,transform:`rotate(-90 14 ${(it+rt)/2})`,textAnchor:"middle",fontSize:11,fill:h.label,children:j}),
|
|
7
|
-
/* @__PURE__ */g("g",{clipPath:`url(#${Q})`,children:R({x:lt,y:nt,left:tt,right:et,top:it,bottom:rt,width:B,height:b,clipId:Q,active:G})}),E?.({x:lt,y:nt,left:tt,right:et,top:it,bottom:rt,width:B,height:b,clipId:Q,active:G}),y.map((t,e)=>e%ht===0?/* @__PURE__ */g("text",{x:"start"===C?lt(e):lt.center(e),y:b-8,textAnchor:"middle",fontSize:11,fill:h.label,style:{fontVariantNumeric:"tabular-nums"},children:ct(t)},`x${e}`):null),y.map((t,e)=>/* @__PURE__ */g("rect",{x:lt.center(e)-(et-tt)/y.length/2,y:it,width:(et-tt)/y.length,height:rt-it,fill:"transparent",onMouseEnter:()=>O(e),onClick:z?()=>z(e):void 0,style:z?{cursor:"pointer"}:void 0},`h${e}`))]}),U&&null!==G&&
|
|
8
|
-
/* @__PURE__ */g("div",{className:"pointer-events-none absolute top-2 z-10",style:t(lt.center(G),lt.bandwidth,B),children:U(G)})]})}export{y as CartesianPlot};
|
package/dist/chunk-S2OIRC5H.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import{CountBadge as e}from"./chunk-MAOJENIB.js";import{Icon as n}from"./chunk-FSPFV4MI.js";import{useShellStrings as i,useShellLocale as t}from"./chunk-E6UCGCOC.js";import{formatPlain as r}from"./chunk-C3QOHMR6.js";import{useState as a,useId as s}from"react";import{jsx as o,jsxs as c,Fragment as l}from"react/jsx-runtime";var d="px-4 @max-[260px]/acc:px-3",h={band:{head:`${d} py-3 bg-(--rosh-fold-band)`,press:"hover:bg-(--rosh-fold-band-hover)",title:"text-base font-semibold text-(--ink-strongest)",chev:"text-(--ink-strongest)",body:`${d} pb-2`},row:{head:`${d} py-2`,press:"hover:bg-gray-50",title:"text-sm font-medium text-(--ink-strong)",chev:"text-(--ink-strong)",body:`${d} pb-2`}},m=e=>[...e].map(e=>/[A-Za-z0-9_-]/.test(e)?e:`-u${e.codePointAt(0).toString(16)}-`).join(""),u="m-0 p-0 border-0 [font:inherit] [letter-spacing:inherit] [text-transform:inherit]";function f({items:d,defaultOpenIds:f=[],openIds:p,onOpenChange:b,allowMultiple:v=!1,level:x=3,tier:$="band",className:g=""}){const N=h[$],y=i(),k=t(),[w,j]=a(f),C=s(),O=`h${x}`,I=p??w;/* @__PURE__ */
|
|
2
|
-
return o("div",{"data-accordion":$,className:`@container/acc flex flex-col ${"band"===$?"gap-0.5":""} ${g}`.trim(),children:d.map(i=>{const t=I.includes(i.id),a=`${C}-${m(i.id)}-head`,s=`${C}-${m(i.id)}-panel`;/* @__PURE__ */
|
|
3
|
-
return c("div",{children:[
|
|
4
|
-
/* @__PURE__ */o(O,{className:u,children:/* @__PURE__ */c("button",{type:"button",id:a,disabled:i.disabled,"aria-expanded":t,"aria-controls":t?s:void 0,onClick:()=>(e=>{const n=I.includes(e)?I.filter(n=>n!==e):v?[...I,e]:[e];void 0===p&&j(n),b?.(n)})(i.id),className:`flex w-full items-center gap-2 text-left transition-colors duration-(--motion-fast) disabled:cursor-not-allowed disabled:opacity-50 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--rosh-focus-ring-solid)] ${N.head} ${N.press}`,children:[null!=i.icon&&/* @__PURE__ */o("span",{"aria-hidden":"true",className:`inline-flex h-4 w-4 shrink-0 items-center justify-center ${N.chev}`,children:i.icon}),
|
|
5
|
-
/* @__PURE__ */o("span",{className:`min-w-0 flex-1 ${N.title}`,children:i.title}),"number"==typeof i.count&&i.count>0&&
|
|
6
|
-
/* @__PURE__ */c(l,{children:[
|
|
7
|
-
/* @__PURE__ */o("span",{"aria-hidden":"true",className:"inline-flex",children:/* @__PURE__ */o(e,{count:i.count,tone:"accent"})}),
|
|
8
|
-
/* @__PURE__ */o("span",{className:"sr-only",children:y.accordion.changed(r(i.count,k))})]}),
|
|
9
|
-
/* @__PURE__ */o("span",{"data-fold-chevron":"","aria-hidden":"true",className:"inline-flex h-6 w-6 shrink-0 items-center justify-center",children:/* @__PURE__ */o(n,{name:"chevron-right","aria-hidden":"true",strokeWidth:"2",className:`h-4 w-4 transition-transform duration-(--motion-base) motion-reduce:transition-none ${N.chev} ${t?"rotate-90":""}`})})]})}),t&&/* @__PURE__ */o("div",{id:s,role:"region","aria-labelledby":a,className:N.body,children:i.content})]},i.id)})})}function p({title:e,icon:n,tier:i="band",level:t=3,id:r,className:a=""}){const s=h[i],l=`h${t}`;/* @__PURE__ */
|
|
10
|
-
return o("div",{"data-accordion-heading":i,className:`@container/acc ${a}`.trim(),children:/* @__PURE__ */c(l,{id:r,className:`${u} flex items-center gap-2 ${s.head}`,children:[null!=n&&/* @__PURE__ */o("span",{"aria-hidden":"true",className:`inline-flex h-4 w-4 shrink-0 items-center justify-center ${s.chev}`,children:n}),
|
|
11
|
-
/* @__PURE__ */o("span",{className:`min-w-0 flex-1 ${s.title}`,children:e})]})})}function b({children:e,className:n=""}){/* @__PURE__ */
|
|
12
|
-
return o("div",{className:`@container/acc ${n}`.trim(),children:/* @__PURE__ */o("div",{"data-accordion-body":"",className:d,children:e})})}export{f as Accordion,b as AccordionBody,p as AccordionHeading,m as accordionIdOf};
|
package/dist/chunk-SB7OTZI4.js
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import{toast_default as e}from"./chunk-4NXMMWL6.js";import{useShellStrings as t}from"./chunk-E6UCGCOC.js";import{forwardRef as r,useRef as n,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 h=["#ef4444","#f97316","#eab308","#22c55e","#3b82f6","#8b5cf6","#000000","#ffffff"],u=[{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),y=r(function({src:r,filename:y,onApply:m,onCancel:g},C){const L=n(null),z=n(null),D=n(null),E=n(null),P=t().annotator,$=n(P);$.current=P;const[I,W]=o("select"),[S,B]=o(h[0]),[R,j]=o(4),[H,F]=o(24),[T,U]=o(u[0].id),[A,O]=o(!0),[K,V]=o(!1),[X,Z]=o(!1),[G,q]=o(null),[Y,_]=o(null),[J,Q]=o(6),[ee,te]=o(12),[re,ne]=o([]),[oe,ie]=o(null),[ae,le]=o(null),[ce,se]=o(null),[de,he]=o(1),[ue,pe]=o(null),[ye,xe]=o(null),[me,ge]=o(null),we=n(null),[fe,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(()=>re.find(e=>e.id===oe)??null,[re,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&&(F(Me.size),U(Me.font),O(Me.bold),V(Me.italic),Z(Me.underline),q(Me.borderColor),_(Me.background),Q(Me.padding)))},[oe]),a(()=>{const t=new Image;t.crossOrigin="anonymous",t.onload=()=>{E.current=t,le({w:t.naturalWidth,h:t.naturalHeight}),ne([]),ie(null)},t.onerror=()=>e.error($.current.loadFailed),t.src=r},[r]),a(()=>{if(!ae)return;const e=()=>{const e=L.current;if(!e)return;const t=e.getBoundingClientRect(),r=Math.max(0,t.width-32),n=Math.max(0,t.height-32);if(0===r||0===n)return;const o=ae.w/ae.h;let i=ae.w,a=ae.h;i>r&&(i=r,a=i/o),a>n&&(a=n,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 Ce=i(()=>re.filter(e=>"mosaic"===e.type),[re]);a(()=>{const e=E.current,t=z.current;if(!e||!t||!ae)return;t.width=ae.w,t.height=ae.h;const r=t.getContext("2d");r.drawImage(e,0,0);for(const e of Ce)N(r,e)},[ae,Ce,ce]);const Ne=e=>{const t=D.current;if(!t)return{x:0,y:0};const r=t.createSVGPoint();r.x=e.clientX,r.y=e.clientY;const n=t.getScreenCTM();if(!n)return{x:0,y:0};const o=r.matrixTransform(n.inverse());return{x:o.x,y:o.y}},Le=e=>{we.current=e,be(!0)};a(()=>{if(!fe)return;const e=e=>{const t=we.current;if(!t)return;const r=Ne(e);if("draw"===t.kind)pe(b(I,t.start,r,S,R,ee));else if("pen"===t.kind){const e=t.points[t.points.length-1];(Math.abs(r.x-e.x)>1||Math.abs(r.y-e.y)>1)&&(t.points.push(r),pe({id:"",type:"draw",points:t.points.slice(),color:S,stroke:R}))}else if("crop"===t.kind)ge(M(t.start,r));else if("move"===t.kind){const e=r.x-t.start.x,n=r.y-t.start.y;ne(r=>r.map(r=>r.id===t.id?v(t.original,e,n):r))}else"resize"===t.kind&&ne(e=>e.map(e=>e.id===t.id?function(e,t,r){if("arrow"===e.type)return"start"===t?{...e,x1:r.x,y1:r.y}:"end"===t?{...e,x2:r.x,y2:r.y}:e;if("text"===e.type||"draw"===e.type)return e;const n=e.x,o=e.x+e.w,i=e.y,a=e.y+e.h;let l=n,c=i,s=o,d=a;"nw"===t&&(l=r.x,c=r.y);"ne"===t&&(s=r.x,c=r.y);"se"===t&&(s=r.x,d=r.y);"sw"===t&&(l=r.x,d=r.y);const h=M({x:l,y:c},{x:s,y:d});return{...e,x:h.x,y:h.y,w:h.w,h:h.h}}(t.original,t.corner,r):e))},t=()=>{const e=we.current;if(we.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 r={...e,id:p()};return ne(e=>[...e,r]),ie(r.id),W("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:S,stroke:R};ne(e=>[...e,t]),ie(t.id),W("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)}},[fe,I,S,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(),ne(e=>e.filter(e=>e.id!==oe)),ie(null)):"Escape"===e.key&&ie(null))):(e.preventDefault(),ne(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:K,underline:X}[e];"bold"===e&&O(t),"italic"===e&&V(t),"underline"===e&&Z(t),oe&&ne(r=>r.map(r=>r.id===oe&&"text"===r.type?{...r,[e]:t}:r))},De=e=>{q(e),oe&&ne(t=>t.map(t=>t.id===oe&&"text"===t.type?{...t,borderColor:e}:t))},Ee=e=>{_(e),oe&&ne(t=>t.map(t=>t.id===oe&&"text"===t.type?{...t,background:e}:t))},Pe=e=>{if(!ye)return;const t=e??ye.value;if(!t.trim())return ye.editingId&&ne(e=>e.filter(e=>e.id!==ye.editingId)),void xe(null);if(ye.editingId)ne(e=>e.map(e=>e.id===ye.editingId&&"text"===e.type?{...e,text:t}:e));else{const e={id:p(),type:"text",x:ye.x,y:ye.y,text:t,color:S,size:H,font:T,bold:A,italic:K,underline:X,borderColor:G,background:Y,padding:J};ne(t=>[...t,e]),ie(e.id),W("select")}xe(null)},$e=async()=>{const e=z.current,t=D.current;if(!e||!t||!ae)return null;const r=document.createElement("canvas");r.width=ae.w,r.height=ae.h;const n=r.getContext("2d");n.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}),n.drawImage(c,0,0,ae.w,ae.h),URL.revokeObjectURL(l),r};l(C,()=>({save:async()=>{const t=await $e();t&&t.toBlob(t=>{if(!t)return void e.error($.current.exportFailed);const r=URL.createObjectURL(t),n=document.createElement("a");n.href=r;const o=y.replace(/\.[^.]+$/,"");n.download=`${o}-annotated.png`,n.click(),URL.revokeObjectURL(r)},"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,y]);const Ie=i(()=>[{id:"select",label:P.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:P.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:P.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:P.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:P.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:P.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:P.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:P.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"})})}],[P]),We=e=>"p-2 rounded transition-colors "+(e?"bg-blue-500 text-white":"text-gray-700 hover:bg-gray-200"),Se=Me?.type??("select"===I?null:I),Be="rect"===Se||"circle"===Se||"arrow"===Se||"draw"===Se,Re="rect"===Se,je="text"===Se;/* @__PURE__ */
|
|
2
|
-
return s("div",{className:"flex flex-col h-full bg-gray-100",children:[
|
|
3
|
-
/* @__PURE__ */s("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-gray-200 bg-white shrink-0 flex-wrap text-xs",children:[Ie.map(e=>/* @__PURE__ */c("button",{onClick:()=>{W(e.id),ie(null)},title:e.label,className:We(I===e.id),children:e.icon},e.id)),
|
|
4
|
-
/* @__PURE__ */c("div",{className:"h-5 w-px bg-gray-300 mx-1"}),
|
|
5
|
-
/* @__PURE__ */c("div",{className:"flex items-center gap-1",children:h.map(e=>/* @__PURE__ */c("button",{onClick:()=>(e=>{B(e),oe&&ne(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 "+(S===e?"ring-2 ring-blue-500 ring-offset-1":"border-gray-300"),style:{background:e}},e))}),Be&&/* @__PURE__ */s(d,{children:[
|
|
6
|
-
/* @__PURE__ */c("div",{className:"h-5 w-px bg-gray-300 mx-1"}),
|
|
7
|
-
/* @__PURE__ */s("label",{className:"flex items-center gap-2 text-gray-600",children:[
|
|
8
|
-
/* @__PURE__ */c("span",{children:P.weight}),
|
|
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&&ne(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
|
-
/* @__PURE__ */c("span",{className:"tabular-nums w-5 text-right",children:R})]})]}),Re&&/* @__PURE__ */s(d,{children:[
|
|
11
|
-
/* @__PURE__ */c("div",{className:"h-5 w-px bg-gray-300 mx-1"}),
|
|
12
|
-
/* @__PURE__ */s("label",{className:"flex items-center gap-2 text-gray-600",children:[
|
|
13
|
-
/* @__PURE__ */c("span",{children:P.radius}),
|
|
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&&ne(e=>e.map(e=>e.id===oe&&"rect"===e.type?{...e,radius:t}:e)));var t},className:"w-16 accent-blue-500"}),
|
|
15
|
-
/* @__PURE__ */c("span",{className:"tabular-nums w-6 text-right",children:ee})]})]}),je&&/* @__PURE__ */s(d,{children:[
|
|
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&&ne(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:u.map(e=>/* @__PURE__ */c("option",{value:e.id,children:P[e.name]},e.id))}),
|
|
18
|
-
/* @__PURE__ */c("button",{onClick:()=>ze("bold"),className:We(A),title:P.bold,children:/* @__PURE__ */c("span",{className:"font-bold",children:P.boldLetter})}),
|
|
19
|
-
/* @__PURE__ */c("button",{onClick:()=>ze("italic"),className:We(K),title:P.italic,children:/* @__PURE__ */c("span",{className:"italic",children:P.italicLetter})}),
|
|
20
|
-
/* @__PURE__ */c("button",{onClick:()=>ze("underline"),className:We(X),title:P.underline,children:/* @__PURE__ */c("span",{className:"underline",children:P.underlineLetter})}),
|
|
21
|
-
/* @__PURE__ */s("label",{className:"flex items-center gap-2 text-gray-600",children:[
|
|
22
|
-
/* @__PURE__ */c("span",{children:P.size}),
|
|
23
|
-
/* @__PURE__ */c("input",{type:"range",min:10,max:96,step:1,value:H,onChange:e=>{return t=Number(e.target.value),F(t),void(oe&&ne(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:H})]}),
|
|
25
|
-
/* @__PURE__ */s("label",{className:"flex items-center gap-1 text-gray-600",children:[
|
|
26
|
-
/* @__PURE__ */c("span",{children:P.border}),G?/* @__PURE__ */s(d,{children:[
|
|
27
|
-
/* @__PURE__ */c("input",{type:"color",value:G,onChange:e=>De(e.target.value),title:P.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:P.removeBorder,className:"px-0.5 text-gray-400 hover:text-gray-700",children:"✕"})]}):/* @__PURE__ */c("button",{onClick:()=>De(S),title:P.addBorder,className:"px-2 py-0.5 rounded border border-gray-300 text-gray-600 hover:bg-gray-100",children:P.add})]}),
|
|
29
|
-
/* @__PURE__ */s("label",{className:"flex items-center gap-1 text-gray-600",children:[
|
|
30
|
-
/* @__PURE__ */c("span",{children:P.fill}),Y?/* @__PURE__ */s(d,{children:[
|
|
31
|
-
/* @__PURE__ */c("input",{type:"color",value:Y,onChange:e=>Ee(e.target.value),title:P.fillColor,className:"h-5 w-6 rounded border border-gray-300 bg-white p-0 cursor-pointer"}),
|
|
32
|
-
/* @__PURE__ */c("button",{onClick:()=>Ee(null),title:P.removeFill,className:"px-0.5 text-gray-400 hover:text-gray-700",children:"✕"})]}):/* @__PURE__ */c("button",{onClick:()=>Ee("#ffffff"),title:P.addFill,className:"px-2 py-0.5 rounded border border-gray-300 text-gray-600 hover:bg-gray-100",children:P.add})]}),
|
|
33
|
-
/* @__PURE__ */s("label",{className:"flex items-center gap-2 text-gray-600",children:[
|
|
34
|
-
/* @__PURE__ */c("span",{children:P.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&&ne(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
|
-
/* @__PURE__ */c("div",{className:"h-5 w-px bg-gray-300 mx-1"}),
|
|
38
|
-
/* @__PURE__ */c("button",{onClick:()=>he(e=>Math.max(.25,Math.round(100*(e-.25))/100)),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-700",title:P.zoomOut,children:"−"}),
|
|
39
|
-
/* @__PURE__ */s("span",{className:"text-gray-600 tabular-nums w-10 text-center",children:[Math.round(100*de),"%"]}),
|
|
40
|
-
/* @__PURE__ */c("button",{onClick:()=>he(e=>Math.min(4,Math.round(100*(e+.25))/100)),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-700",title:P.zoomIn,children:"+"}),
|
|
41
|
-
/* @__PURE__ */c("button",{onClick:()=>he(1),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-700",title:P.fitHint,children:P.fit}),
|
|
42
|
-
/* @__PURE__ */c("div",{className:"h-5 w-px bg-gray-300 mx-1"}),
|
|
43
|
-
/* @__PURE__ */c("button",{onClick:()=>{ne(e=>e.slice(0,-1)),ie(null)},disabled:0===re.length,className:"px-2 py-1 rounded hover:bg-gray-200 disabled:opacity-30 text-gray-700",children:P.undo}),
|
|
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||!E.current||!ae)return;const e=me,t=document.createElement("canvas");t.width=Math.round(e.w),t.height=Math.round(e.h);const r=t.getContext("2d"),n=document.createElement("canvas");n.width=ae.w,n.height=ae.h;const o=n.getContext("2d");o.drawImage(E.current,0,0);for(const e of Ce)N(o,e);r.drawImage(n,e.x,e.y,e.w,e.h,0,0,e.w,e.h);const i=new Image;i.onload=()=>{E.current=i,le({w:i.naturalWidth,h:i.naturalHeight}),ne(t=>t.filter(e=>"mosaic"!==e.type).map(t=>v(t,-e.x,-e.y)).filter(e=>function(e,t,r){const n=k(e);return n.x+n.w>0&&n.y+n.h>0&&n.x<t&&n.y<r}(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:P.applyCrop}),
|
|
46
|
-
/* @__PURE__ */c("button",{onClick:()=>ge(null),className:"px-2 py-1 rounded hover:bg-gray-200 text-gray-700",children:P.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:P.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:P.apply})]})]})]}),
|
|
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
|
-
/* @__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(ye)return void Pe();const t=Ne(e);return void xe({x:t.x,y:t.y,value:""})}const t=Ne(e);if("crop"!==I){if("draw"===I)return Le({kind:"pen",points:[t]}),void pe({id:"",type:"draw",points:[t],color:S,stroke:R});pe(b(I,t,t,S,R,ee)),Le({kind:"draw",start:t})}else Le({kind:"crop",start:t})},children:[re.map(e=>/* @__PURE__ */c(x,{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:Ne(e),original:t}))})(t,e),onDoubleClick:()=>{var t;"text"===(t=e).type&&xe({x:t.x,y:t.y,value:t.text,editingId:t.id})},onHandlePointerDown:(t,r)=>((e,t,r)=>{e.stopPropagation(),Le({kind:"resize",id:t.id,corner:r,start:Ne(e),original:t})})(t,e,r)},e.id)),ue&&/* @__PURE__ */c(x,{anno:{...ue,id:"__preview"},preview:!0}),me&&/* @__PURE__ */c(w,{rect:me,imageSize:ae})]}),ye&&/* @__PURE__ */c(f,{pendingText:ye,color:S,size:H,font:u.find(e=>e.id===T)?.css??u[0].css,bold:A,italic:K,underline:X,borderColor:G,background:Y,padding:J,scale:ke,onChange:e=>xe({...ye,value:e}),onCommit:Pe,onCancel:()=>xe(null)})]})}),
|
|
51
|
-
/* @__PURE__ */c("div",{className:"px-3 py-2 border-t border-gray-200 bg-white text-2xs text-gray-500 shrink-0",children:"select"===I?oe?P.hintSelected:P.hintSelect:"text"===I?P.hintText:"crop"===I?P.hintCrop:"draw"===I?P.hintDraw:P.hintShape})]})});function x({anno:e,selected:t,preview:r,zoom:n=1,onPointerDown:o,onDoubleClick:i,onHandlePointerDown:a}){const l=k(e),h=o?{onPointerDown:o,pointerEvents:"all",style:{cursor:"move"}}:{},p=i?{onDoubleClick:i}:{};let y;if("rect"===e.type)y=/* @__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",...h});else if("circle"===e.type)y=/* @__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,...h});else if("arrow"===e.type)y=/* @__PURE__ */c(g,{anno:e,interactive:h});else if("draw"===e.type)y=/* @__PURE__ */c("path",{d:C(e.points),fill:"none",stroke:e.color,strokeWidth:e.stroke,strokeLinecap:"round",strokeLinejoin:"round",...h});else if("mosaic"===e.type)y=/* @__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,...h});else{const t=u.find(t=>t.id===e.font)?.css??u[0].css,r=e.padding??0,n=!!e.borderColor||!!e.background,o=k(e),i=e.borderColor?Math.max(1,Math.round(e.size/12)):0;y=/* @__PURE__ */s("g",{...h,...p,children:[n&&/* @__PURE__ */c("rect",{x:o.x-r,y:o.y-r,width:Math.max(0,o.w)+2*r,height:Math.max(0,o.h)+2*r,rx:Math.min(8,r),ry:Math.min(8,r),fill:e.background??"none",stroke:e.borderColor??"none",strokeWidth:i}),
|
|
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,r)=>/* @__PURE__ */c("tspan",{x:e.x,dy:0===r?0:1.2*e.size,children:t},r))})]})}/* @__PURE__ */
|
|
53
|
-
return s("g",{children:[y,t&&!r&&/* @__PURE__ */s(d,{children:[
|
|
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/n,strokeDasharray:`${6/n},${4/n}`,pointerEvents:"none"}),a&&/* @__PURE__ */c(m,{anno:e,zoom:n,onHandlePointerDown:a})]})]})}function m({anno:e,zoom:t,onHandlePointerDown:r}){const n=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__ */
|
|
55
|
-
return s(d,{children:[
|
|
56
|
-
/* @__PURE__ */c("circle",{cx:e.x1,cy:e.y1,r:n,...i("grab"),onPointerDown:e=>r(e,"start")}),
|
|
57
|
-
/* @__PURE__ */c("circle",{cx:e.x2,cy:e.y2,r:n,...i("grab"),onPointerDown:e=>r(e,"end")})]});if("text"===e.type||"draw"===e.type)return null;const a=e.x,l=e.y,h=e.w,u=e.h;/* @__PURE__ */
|
|
58
|
-
return s(d,{children:[
|
|
59
|
-
/* @__PURE__ */c("circle",{cx:a,cy:l,r:n,...i("nwse-resize"),onPointerDown:e=>r(e,"nw")}),
|
|
60
|
-
/* @__PURE__ */c("circle",{cx:a+h,cy:l,r:n,...i("nesw-resize"),onPointerDown:e=>r(e,"ne")}),
|
|
61
|
-
/* @__PURE__ */c("circle",{cx:a+h,cy:l+u,r:n,...i("nwse-resize"),onPointerDown:e=>r(e,"se")}),
|
|
62
|
-
/* @__PURE__ */c("circle",{cx:a,cy:l+u,r:n,...i("nesw-resize"),onPointerDown:e=>r(e,"sw")})]})}function g({anno:e,interactive:t}){const r=Math.max(12,4*e.stroke),n=Math.atan2(e.y2-e.y1,e.x2-e.x1),o=n+Math.PI-Math.PI/7,i=n+Math.PI+Math.PI/7,a=`M${e.x2},${e.y2} L${e.x2+r*Math.cos(o)},${e.y2+r*Math.sin(o)} L${e.x2+r*Math.cos(i)},${e.y2+r*Math.sin(i)} Z`;/* @__PURE__ */
|
|
63
|
-
return s("g",{...t,children:[
|
|
64
|
-
/* @__PURE__ */c("line",{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,stroke:e.color,strokeWidth:e.stroke,strokeLinecap:"round"}),
|
|
65
|
-
/* @__PURE__ */c("path",{d:a,fill:e.color})]})}function w({rect:e,imageSize:t}){/* @__PURE__ */
|
|
66
|
-
return s("g",{pointerEvents:"none",children:[
|
|
67
|
-
/* @__PURE__ */c("path",{d:`M0,0 H${t.w} V${t.h} H0 Z M${e.x},${e.y} V${e.y+e.h} H${e.x+e.w} V${e.y} Z`,fill:"rgba(0,0,0,0.45)",fillRule:"evenodd"}),
|
|
68
|
-
/* @__PURE__ */c("rect",{x:e.x,y:e.y,width:e.w,height:e.h,fill:"none",stroke:"#fff",strokeWidth:2,strokeDasharray:"8,6"})]})}function f({pendingText:e,color:r,size:o,font:i,bold:l,italic:s,underline:d,borderColor:h,background:u,padding:p,scale:y,onChange:x,onCommit:m,onCancel:g}){const w=n(null),f=t().annotator;a(()=>{const e=requestAnimationFrame(()=>{w.current?.focus(),w.current?.select?.()});return()=>cancelAnimationFrame(e)},[]);const b=()=>m(w.current?.value),v=h?Math.max(1,Math.round(o/12)):0;/* @__PURE__ */
|
|
69
|
-
return c("div",{style:{position:"absolute",left:e.x*y+"px",top:e.y*y+"px",transform:"translateY(-2px)",zIndex:5},onPointerDown:e=>e.stopPropagation(),children:/* @__PURE__ */c("textarea",{ref:w,value:e.value,onChange:e=>x(e.target.value),onBlur:b,onKeyDown:e=>{"Escape"===e.key?(e.preventDefault(),g()):"Enter"!==e.key||e.shiftKey||(e.preventDefault(),b())},placeholder:f.textPlaceholder,rows:1,className:"outline-none resize-none shadow-(--elevation-panel)",style:{color:r,fontSize:o*y+"px",fontFamily:i,fontWeight:l?700:400,fontStyle:s?"italic":"normal",textDecoration:d?"underline":void 0,minWidth:80,padding:p*y+"px",borderRadius:Math.min(8,p)*y+"px",border:h?`${v*y}px solid ${h}`:"1px dashed #60a5fa",background:u??"rgba(255,255,255,0.95)"}})})}function b(e,t,r,n,o,i){if("rect"===e){const e=M(t,r);return{id:"",type:"rect",x:e.x,y:e.y,w:e.w,h:e.h,color:n,stroke:o,radius:i}}if("circle"===e){const e=M(t,r);return{id:"",type:"circle",x:e.x,y:e.y,w:e.w,h:e.h,color:n,stroke:o}}if("arrow"===e)return{id:"",type:"arrow",x1:t.x,y1:t.y,x2:r.x,y2:r.y,color:n,stroke:o};if("mosaic"===e){const e=M(t,r);return{id:"",type:"mosaic",x:e.x,y:e.y,w:e.w,h:e.h}}return null}function v(e,t,r){return"arrow"===e.type?{...e,x1:e.x1+t,y1:e.y1+r,x2:e.x2+t,y2:e.y2+r}:"draw"===e.type?{...e,points:e.points.map(e=>({x:e.x+t,y:e.y+r}))}:(e.type,{...e,x:e.x+t,y:e.y+r})}function k(e){if("arrow"===e.type){return{x:Math.min(e.x1,e.x2),y:Math.min(e.y1,e.y2),w:Math.abs(e.x2-e.x1),h:Math.abs(e.y2-e.y1)}}if("draw"===e.type){if(0===e.points.length)return{x:0,y:0,w:0,h:0};let t=e.points[0].x,r=e.points[0].x,n=e.points[0].y,o=e.points[0].y;for(const i of e.points)i.x<t&&(t=i.x),i.x>r&&(r=i.x),i.y<n&&(n=i.y),i.y>o&&(o=i.y);return{x:t,y:n,w:r-t,h:o-n}}if("text"===e.type){const t=e.text.split("\n"),r=t.reduce((e,t)=>Math.max(e,t.length),0);return{x:e.x,y:e.y,w:r*e.size*.55,h:t.length*e.size*1.2}}return{x:e.x,y:e.y,w:e.w,h:e.h}}function M(e,t){return{x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),w:Math.abs(e.x-t.x),h:Math.abs(e.y-t.y)}}function C(e){if(0===e.length)return"";let t=`M ${e[0].x} ${e[0].y}`;for(let r=1;r<e.length;r++)t+=` L ${e[r].x} ${e[r].y}`;return t}function N(e,t){const r=Math.round(Math.max(0,t.x)),n=Math.round(Math.max(0,t.y)),o=Math.round(Math.min(e.canvas.width-r,t.w)),i=Math.round(Math.min(e.canvas.height-n,t.h));if(o<2||i<2)return;const a=e.getImageData(r,n,o,i);for(let e=0;e<i;e+=12)for(let t=0;t<o;t+=12){let r=0,n=0,l=0,c=0,s=0;const d=Math.min(12,o-t),h=Math.min(12,i-e);for(let i=0;i<h;i++)for(let h=0;h<d;h++){const d=4*((e+i)*o+(t+h));r+=a.data[d],n+=a.data[d+1],l+=a.data[d+2],c+=a.data[d+3],s++}r=Math.round(r/s),n=Math.round(n/s),l=Math.round(l/s),c=Math.round(c/s);for(let i=0;i<h;i++)for(let s=0;s<d;s++){const d=4*((e+i)*o+(t+s));a.data[d]=r,a.data[d+1]=n,a.data[d+2]=l,a.data[d+3]=c}}e.putImageData(a,r,n)}export{y as ImageAnnotator_default};
|
package/dist/chunk-SRKSGUGT.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import{Calendar as e,fromKey as t}from"./chunk-JPRJQ6B7.js";import{FILTER_ON as r,FILTER_ON_INK as n,FILTER_OFF as a}from"./chunk-PF3ANJFI.js";import{calendarNames as o}from"./chunk-5OTS2G3M.js";import{buttonClasses as l}from"./chunk-K7U4RWXJ.js";import{Icon as i}from"./chunk-FSPFV4MI.js";import{onOverlayOpen as s}from"./chunk-PGN5ME7B.js";import{Z_LAYERS as d}from"./chunk-62LW225J.js";import{useDropdownPosition as c}from"./chunk-GLUJS42B.js";import{useBrowserLayoutEffect as m}from"./chunk-D65T4H6J.js";import{glassStyle as u}from"./chunk-DTJRIWFR.js";import{useShellStrings as p,useShellLocale as h}from"./chunk-E6UCGCOC.js";import{useState as f,useRef as g,useId as b,useEffect as x}from"react";import{createPortal as y}from"react-dom";import{jsxs as v,Fragment as w,jsx as N}from"react/jsx-runtime";var k=["last2Weeks","lastMonth","last3Months","last6Months","last12Months"],C=e=>`${e.getFullYear()}-${M(e.getMonth()+1)}`,M=e=>String(e).padStart(2,"0");function $(e){return`${e.getFullYear()}-${M(e.getMonth()+1)}-${M(e.getDate())}`}function D(e,t){const r=t.getFullYear(),n=t.getMonth(),a=new Date(r,n,t.getDate()),o=new Date(r,n,0),l=e=>new Date(r,n-e,1);switch(e){case"last2Weeks":return{from:$(new Date(r,n,t.getDate()-14)),to:$(a)};case"lastMonth":return{from:$(l(1)),to:$(o)};case"last3Months":return{from:$(l(3)),to:$(o)};case"last6Months":return{from:$(l(6)),to:$(o)};case"last12Months":return{from:$(l(12)),to:$(o)}}}function W(e,t,r){const n=C(e);return t&&n<t.slice(0,7)?t.slice(0,7):r&&n>r.slice(0,7)?r.slice(0,7):n}function j(e){const[t,r,n]=e.split("-").map(Number);return new Date(t,r-1,n)}function F(e){const[t,r,n]=e.split("-");return t&&r&&n?`${n}/${r}/${t}`:e}var S=/* @__PURE__ */new Map;function O({from:M,to:$,onChange:O,formatDisplay:J,clearable:R,required:T=!1,name:B,id:E,"aria-labelledby":G,"aria-label":H,weekStartsOn:I,placeholder:L,fullWidth:U=!1,min:Y,max:P,disabled:q=!1,allowOpenEnd:A=!1}){const V=p().dateRange,z=h(),K=J??(z?function(e){let t=S.get(e);t||(t=new Intl.DateTimeFormat(e,{year:"numeric",month:"2-digit",day:"2-digit",timeZone:"UTC",calendar:"gregory"}),S.set(e,t));const r=t;return e=>{const[t,n,a]=e.split("-").map(Number);return t&&n&&a?r.format(new Date(Date.UTC(t,n-1,a))):e}}(z):F),Q=L??V.placeholder,X=R??!T,[Z,_]=f(!1),[ee,te]=f(M),[re,ne]=f($),[ae,oe]=f(null),[le,ie]=f("from"),se=g(null),de=g(null),ce=g(null),me=b(),ue=b(),pe=b(),[he,fe]=f(!1),ge=c(se,Z,{preferredMaxWidth:520,preferredMaxHeight:he?720:560,popupRef:ce}),be=g(null),xe=g(null),[ye,ve]=f(!0);m(()=>{const e=xe.current;if(!Z||!he||!e)return;const t=getComputedStyle(e).gridTemplateColumns.split(" ").filter(Boolean).length||1,r=parseFloat(getComputedStyle(e).columnGap)||0,n=(e.clientWidth-r*(t-1))/t,a=Math.max(...Array.from(e.querySelectorAll("[data-preset-measure]"),e=>e.offsetWidth))+24+2<=n+.5;a!==ye&&ve(a)});const we=g(null);m(()=>{const e=ce.current;if(!Z||!ge||!e)return;const t=getComputedStyle(e),r=ge.maxWidth-(e.offsetWidth-e.clientWidth)-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight);if(he)null!==we.current&&we.current<=r&&fe(!1);else{const e=be.current?.offsetWidth??0;if(0===e)return;we.current=e,e>r+.5&&fe(!0)}});const[Ne,ke]=f(!1);m(()=>{const e=!!E&&(de.current?.labels?.length??0)>0;e!==Ne&&ke(e)});const Ce=!!H||!!G||Ne,Me=/* @__PURE__ */new Date,[$e,De]=f(()=>M?C(j(M)):W(Me,Y,P)),We=k.filter(e=>((e,t,r)=>(!t||e.from>=t)&&(!r||e.to<=r))(D(e,Me),Y,P)),je=e=>e?K(e):"";x(()=>{if(!Z)return;const e=e=>{const t=e.target;se.current?.contains(t)||ce.current?.contains(t)||_(!1)};document.addEventListener("mousedown",e);const t=s(()=>_(!1));return()=>{document.removeEventListener("mousedown",e),t()}},[Z]),x(()=>{q&&_(!1)},[q]);const Fe=()=>{O("",""),_(!1)},Se=M&&$?`${je(M)} — ${je($)}`:M?V.fromOnly(je(M)):$?V.toOnly(je($)):"",Oe=o(z),Je=e=>{const r=t(e);return r?Oe.longDate(r.getFullYear(),r.getMonth(),r.getDate()):e},Re=M&&$?V.range(Je(M),Je($)):M?V.fromOnly(Je(M)):$?V.toOnly(Je($)):Q,Te=e=>he?"h-8 w-full min-w-0 truncate rounded-(--radius-control) border px-3 text-sm transition-colors "+(ae===e?"border-blue-300 bg-blue-50 text-blue-700 font-medium":"border-gray-200 text-gray-700 hover:bg-gray-50"):"h-8 text-left px-3 text-sm rounded-(--radius-control) transition-colors "+(ae===e?"bg-blue-50 text-blue-700 font-medium":"text-gray-700 hover:bg-gray-50"),Be=/* @__PURE__ */v(w,{children:[We.map(e=>/* @__PURE__ */N("button",{type:"button",onClick:()=>(e=>{if("Custom"===e)return;const t=D(e,Me);te(t.from),ne(t.to),oe(e),De(t.from.slice(0,7))})(e),className:Te(e),"aria-label":he?V[e]:void 0,children:he?ye?V[e]:V[`${e}Short`]:V[e]},e)),
|
|
2
|
-
/* @__PURE__ */N("button",{type:"button",onClick:()=>oe("Custom"),className:Te("Custom"),children:V.custom})]}),Ee=(e,t)=>A?/* @__PURE__ */N("button",{type:"button","data-range-end":e,"aria-pressed":le===e,onClick:()=>ie(e),className:"flex items-center gap-2 whitespace-nowrap rounded rosh-focus-ring",children:t}):/* @__PURE__ */N("div",{className:"flex items-center gap-2 whitespace-nowrap",children:t}),Ge=e=>A&&le===e?" ring-1 ring-blue-400":"",He=
|
|
3
|
-
/* @__PURE__ */N(e,{mode:"range",min:Y,max:P,value:ee||null,endValue:re||null,month:$e,onMonthChange:De,onSelect:e=>{oe("Custom"),A?"from"===le?(re&&e>re?(te(re),ne(e)):te(e),ie("to")):ee&&e<ee?(ne(ee),te(e)):ne(e):!ee||ee&&re?(te(e),ne("")):e<ee?(ne(ee),te(e)):ne(e)},weekStartsOn:I,"aria-label":V.dialog});/* @__PURE__ */
|
|
4
|
-
return v("div",{className:"relative"+(U?" w-full":""),ref:se,children:[
|
|
5
|
-
/* @__PURE__ */v("div",{className:`${U?"flex w-full":"inline-flex"} h-8 items-center gap-2 border rounded-lg px-3 text-sm focus-within:border-blue-500 has-focus-visible:ring-1 has-focus-visible:ring-[color:var(--rosh-focus-ring-deep)] ${M||$?`${r} ${n}`:a}${q?" cursor-not-allowed opacity-60":""}`,children:[
|
|
6
|
-
/* @__PURE__ */v("button",{ref:de,type:"button",onClick:()=>{q||(te(M),ne($),oe(null),ie(M&&!$?"to":"from"),De(M?C(j(M)):W(Me,Y,P)),_(!0))},"aria-haspopup":"dialog","aria-expanded":Z,id:E,disabled:q||void 0,"aria-label":H,"aria-labelledby":G,"aria-describedby":[Ce?ue:void 0,T?pe:void 0].filter(Boolean).join(" ")||void 0,"aria-controls":Z?me:void 0,className:"inline-flex items-center gap-2 rosh-focus-ring"+(U?" min-w-0 flex-1 justify-start":""),children:[
|
|
7
|
-
/* @__PURE__ */N(i,{name:"date",className:"w-4 h-4 shrink-0",strokeWidth:"2","aria-hidden":"true"}),
|
|
8
|
-
/* @__PURE__ */N("span",{className:"truncate",children:Se||Q})]}),X&&!q&&(M||$)&&/* @__PURE__ */N("button",{type:"button",onClick:Fe,"aria-label":V.clearRange,className:"text-blue-400 hover:text-red-500 rosh-focus-ring focus-visible:ring-1 focus-visible:ring-[color:var(--rosh-focus-ring-deep)] rounded",children:"×"})]}),Ce&&/* @__PURE__ */N("span",{id:ue,className:"sr-only",children:Re}),T&&/* @__PURE__ */N("span",{id:pe,className:"sr-only",children:V.required}),B&&/* @__PURE__ */v(w,{children:[
|
|
9
|
-
/* @__PURE__ */N("input",{type:"hidden",name:B.from,value:M,disabled:q||void 0}),
|
|
10
|
-
/* @__PURE__ */N("input",{type:"hidden",name:B.to,value:$,disabled:q||void 0})]}),Z&&y(
|
|
11
|
-
/* @__PURE__ */v("div",{ref:ce,id:me,role:"dialog","aria-label":V.dialog,"data-layout":he?"stacked":"side",className:"fixed rounded-(--radius-popup) p-4",style:{zIndex:d.popup,left:ge?.left,right:ge?.right,top:ge?.top,bottom:ge?.bottom,width:he&&ge?ge.maxWidth:"max-content",maxWidth:ge?.maxWidth,maxHeight:ge?.maxHeight,overflowY:"auto",visibility:ge?void 0:"hidden",...u()},children:[
|
|
12
|
-
/* @__PURE__ */v("div",{className:he?"mb-3 flex flex-wrap items-center gap-x-4 gap-y-2":"flex items-center gap-3 mb-3",children:[Ee("from",/* @__PURE__ */v(w,{children:[
|
|
13
|
-
/* @__PURE__ */N("span",{className:"text-xs font-medium text-gray-500",children:V.from}),
|
|
14
|
-
/* @__PURE__ */N("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${ee?"border-blue-300 bg-blue-50 text-blue-700":"border-gray-200 bg-gray-50 text-gray-400"}${Ge("from")}`,children:ee?je(ee):V.start})]})),!he&&/* @__PURE__ */N("span",{className:"text-gray-300",children:"—"}),Ee("to",/* @__PURE__ */v(w,{children:[
|
|
15
|
-
/* @__PURE__ */N("span",{className:"text-xs font-medium text-gray-500",children:V.to}),
|
|
16
|
-
/* @__PURE__ */N("span",{className:`text-sm px-2 py-1 rounded border min-w-[90px] ${re?"border-blue-300 bg-blue-50 text-blue-700":"border-gray-200 bg-gray-50 text-gray-400"}${Ge("to")}`,children:re?je(re):V.end})]}))]}),he?/* @__PURE__ */v(w,{children:[We.length>0&&/* @__PURE__ */v("div",{className:"mb-3 @container",children:[!ye&&/* @__PURE__ */N("p",{"aria-hidden":"true",className:"mb-1 text-xs font-medium text-gray-500",children:V.lastHeading}),
|
|
17
|
-
/* @__PURE__ */v("div",{ref:xe,className:"relative grid grid-cols-2 gap-2 @min-[320px]:grid-cols-3",children:[Be,We.map(e=>/* @__PURE__ */N("span",{"data-preset-measure":"","aria-hidden":"true",className:"invisible absolute left-0 top-0 whitespace-nowrap text-sm",children:V[e]},e))]})]}),
|
|
18
|
-
/* @__PURE__ */N("div",{className:"w-full",children:He})]}):
|
|
19
|
-
/* @__PURE__ */v("div",{ref:be,className:"flex w-max gap-4",children:[
|
|
20
|
-
/* @__PURE__ */N("div",{className:"w-64",children:He}),We.length>0&&/* @__PURE__ */N("div",{className:"border-l border-gray-200 pl-4 flex flex-col gap-1 min-w-[130px]",children:Be})]}),
|
|
21
|
-
/* @__PURE__ */v("div",{className:"flex flex-wrap justify-end gap-2 mt-4 pt-3 border-t border-gray-200",children:[X&&/* @__PURE__ */N("button",{type:"button",onClick:Fe,className:l({variant:"ghost"}),children:V.clear}),
|
|
22
|
-
/* @__PURE__ */N("button",{type:"button",onClick:()=>_(!1),className:l({variant:"secondary"}),children:V.cancel}),
|
|
23
|
-
/* @__PURE__ */N("button",{type:"button",onClick:()=>{O(ee,re),_(!1)},disabled:A?!ee&&!re:!ee||!re,className:l({variant:"primary"}),children:V.apply})]})]}),document.body)]})}export{O as DateRangePicker,D as presetRange,$ as toISODate};
|
package/dist/chunk-SURSVJA2.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{Fragment as e}from"react";import{jsx as r,jsxs as a}from"react/jsx-runtime";function t({icon:t,heading:s,subject:l,meta:c=[],actions:i,footer:n,children:h}){const d=[...l?[/* @__PURE__ */r("b",{children:l},"subject")]:[],...c.filter(e=>null!=e&&!1!==e&&""!==e)];/* @__PURE__ */
|
|
2
|
-
return a("section",{className:"rosh-tl-card border-gray-200 bg-gray-50",children:[
|
|
3
|
-
/* @__PURE__ */a("div",{className:"rosh-tl-head",children:[
|
|
4
|
-
/* @__PURE__ */a("div",{className:"rosh-tl-head-main text-gray-800",children:[t&&/* @__PURE__ */r("span",{className:"rosh-tl-ico","aria-hidden":"true",children:t}),
|
|
5
|
-
/* @__PURE__ */r("h4",{className:"rosh-tl-title",children:s}),d.length>0&&/* @__PURE__ */r("p",{className:"rosh-tl-meta text-gray-500",children:d.map((t,s)=>
|
|
6
|
-
/* @__PURE__ */a(e,{children:[s>0&&/* @__PURE__ */r("span",{"aria-hidden":"true",children:" · "}),t]},s))})]}),i&&/* @__PURE__ */r("span",{className:"rosh-tl-head-actions",children:i})]}),h,n&&/* @__PURE__ */r("div",{className:"rosh-tl-foot border-gray-200",children:n})]})}export{t as TimelineCard};
|
package/dist/chunk-TH6EAYMO.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import{Tree as e,TreeRow as n,TreeGroup as l}from"./chunk-EL2RLUT6.js";import{MarqueeBox as a}from"./chunk-IC72MGON.js";import{EmptyState as r}from"./chunk-6GWZ5UPX.js";import{ImageLightbox as i}from"./chunk-TIQKDAON.js";import{DescriptionList as t}from"./chunk-SACUSHVN.js";import{Drawer as o}from"./chunk-J47HXHSL.js";import{Breadcrumbs as d}from"./chunk-6SMQNPWS.js";import{useGridSelection as s}from"./chunk-VLKDWKVR.js";import{useMarquee as c}from"./chunk-OLFYNMTD.js";import{ROOT_KEY as u,mediaLibraryMenu as m}from"./chunk-SZIENHKR.js";import{useMediaMoveItems as p}from"./chunk-DFDDRKIJ.js";import{copyToClipboard as h}from"./chunk-5PY4H4ZJ.js";import{DropdownMenu as f}from"./chunk-YALPQIBR.js";import{NativeSelect as g}from"./chunk-454DAGYG.js";import{MediaUploadGrid as v}from"./chunk-3ZHFKOFX.js";import{MediaUsedInList as y}from"./chunk-63EK6S3W.js";import{Segmented as k}from"./chunk-N6DTTOB6.js";import{Checkbox_default as b}from"./chunk-CGZBDI6C.js";import{useContextMenu as w,ContextMenu as x}from"./chunk-ZWAVSUWT.js";import{Banner as N}from"./chunk-UZMZ2EDW.js";import{Input_default as C}from"./chunk-GX2GSDJP.js";import{IconButton_default as I}from"./chunk-4CANQ3B3.js";import{useFileIntake as D,FileIntakeAlert as S}from"./chunk-YDYDR72S.js";import{ColoredBadge as j}from"./chunk-ET2EF5CI.js";import{Button_default as z}from"./chunk-4IU5BSVE.js";import{buttonClasses as T}from"./chunk-K7U4RWXJ.js";import{Icon as F}from"./chunk-FSPFV4MI.js";import{Tooltip as O}from"./chunk-22S6LG6D.js";import{usePlotWidth as E}from"./chunk-MAFUXCPZ.js";import{useShellStrings as P}from"./chunk-E6UCGCOC.js";import{useRef as A,useMemo as L,useCallback as M,useState as R,useEffect as U}from"react";import{jsxs as K,Fragment as B,jsx as G}from"react/jsx-runtime";var W="application/x-efficient-media-files",H="application/x-efficient-media-folder",J="application/x-efficient-media-file";function Z(e){if(!e||!Array.from(e.types).includes(J))return null;try{const n=JSON.parse(e.getData(J));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 V={type:"all",use:"any",sort:"newest"},$={lock:/* @__PURE__ */G(F,{name:"lock","aria-hidden":"true",className:"h-4 w-4"}),folder:/* @__PURE__ */G(F,{name:"folder","aria-hidden":"true",className:"h-4 w-4"}),folderOpen:/* @__PURE__ */G(F,{name:"folder-open","aria-hidden":"true",className:"h-4 w-4"}),folderPlus:/* @__PURE__ */G(F,{name:"folder-plus","aria-hidden":"true",className:"h-4 w-4"}),trash:/* @__PURE__ */G(F,{name:"trash","aria-hidden":"true",className:"h-4 w-4"}),upload:/* @__PURE__ */G(F,{name:"upload","aria-hidden":"true",className:"h-4 w-4"}),search:/* @__PURE__ */G(F,{name:"search","aria-hidden":"true",className:"h-4 w-4"}),grid:/* @__PURE__ */G(F,{name:"grid","aria-hidden":"true",className:"h-4 w-4"}),list:/* @__PURE__ */G(F,{name:"list","aria-hidden":"true",className:"h-4 w-4"}),more:/* @__PURE__ */G(F,{name:"more","aria-hidden":"true",className:"h-4 w-4"}),copy:/* @__PURE__ */G(F,{name:"copy","aria-hidden":"true",className:"h-4 w-4"}),edit:/* @__PURE__ */G(F,{name:"edit","aria-hidden":"true",className:"h-4 w-4"}),swap:/* @__PURE__ */G(F,{name:"swap","aria-hidden":"true",className:"h-4 w-4"}),crop:/* @__PURE__ */G(F,{name:"crop","aria-hidden":"true",className:"h-4 w-4"}),external:/* @__PURE__ */G(F,{name:"external","aria-hidden":"true",className:"h-4 w-4"}),undo:/* @__PURE__ */G(F,{name:"undo","aria-hidden":"true",className:"h-4 w-4"})},X={link:/* @__PURE__ */G(F,{name:"link","aria-hidden":"true",className:"h-3 w-3"}),email:/* @__PURE__ */G(F,{name:"email","aria-hidden":"true",className:"h-3 w-3"}),lock:/* @__PURE__ */G(F,{name:"lock","aria-hidden":"true",className:"h-3 w-3"}),clock:/* @__PURE__ */G(F,{name:"clock","aria-hidden":"true",className:"h-3 w-3"})};function Y({value:e,label:n,onDone:l}){const[a,r]=R(e),i=A(!1),t=e=>{i.current||(i.current=!0,l(e))};/* @__PURE__ */
|
|
2
|
-
return G(C,{size:"sm",autoFocus:!0,"aria-label":n,value:a,onChange:e=>r(e.target.value),onFocus:e=>e.currentTarget.select(),onKeyDown:n=>{n.stopPropagation(),"Enter"===n.key?(n.preventDefault(),t(a.trim()||e)):"Escape"===n.key&&(n.preventDefault(),t(null))},onBlur:()=>t(a.trim()||e),onClick:e=>e.stopPropagation()})}function Q(F){const{mode:Z="manage",layout:Q="auto",location:q,onLocationChange:_,folders:ee,products:ne,allFilesCount:le,trashCount:ae,files:re,query:ie,onQueryChange:te,filters:oe=V,onFiltersChange:de,extraFilters:se,view:ce="grid",onViewChange:ue,selectedIds:me,onSelectionChange:pe,usedIn:he,denied:fe={},accept:ge="image/*,video/*",maxSizeBytes:ve,busy:ye,progress:ke,onUpload:be,onNewFolder:we,onRename:xe,onMove:Ne,onTrash:Ce,onDeleteFolder:Ie,onRestore:De,onDeleteForever:Se,onEmptyTrash:je,onReplace:ze,onCropEdit:Te,onOpenInDesign:Fe,onChoose:Oe,onCancel:Ee,pickNote:Pe,onDragOut:Ae,className:Le=""}=F,Me=P().mediaLibrary,Re=P().media,Ue="pick"===Z,Ke=!Ue,Be=A(null),Ge=E(Be,"phone"===Q?343:1200),We="phone"===Q||"auto"===Q&&Ge<640,He=L(()=>function(e=[]){const n=/* @__PURE__ */new Map,l=(e,a)=>{for(const r of e){const e=[...a,r];n.set(r.id,{node:r,path:e}),r.children&&l(r.children,e)}};return l(e,[]),n}(ne),[ne]),Je=L(()=>new Map(ee.map(e=>[e.id,e])),[ee]),Ze=L(()=>{const e=/* @__PURE__ */new Map;for(const n of ee){const l=n.parentId&&Je.has(n.parentId)?n.parentId:null;e.set(l,[...e.get(l)??[],n])}return e},[ee,Je]),Ve=M(e=>{const n=[];for(let l=e?Je.get(e):void 0;l&&(n.unshift(l),!(n.length>ee.length));l=l.parentId?Je.get(l.parentId):void 0);return n},[Je,ee.length]),$e=M((e,n)=>Ve(e).some(e=>e.id===n),[Ve]),[Xe,Ye]=R(()=>/* @__PURE__ */new Set(["@files"])),Qe=e=>Ye(n=>{const l=new Set(n);return l.has(e)?l.delete(e):l.add(e),l}),qe=M(e=>{Ye(n=>e.every(e=>n.has(e))?n:/* @__PURE__ */new Set([...n,...e]))},[]),_e="files"===(en=q).place?`files:${en.folderId??""}`:"products"===en.place?`products:${en.nodeId??""}`:"trash";var en;U(()=>{if("files"===q.place)qe(["@files",...Ve(q.folderId).slice(0,-1).map(e=>e.id)]);else if("products"===q.place){const e=q.nodeId?He.get(q.nodeId)?.path??[]:[];qe(["@products",...e.slice(0,-1).map(e=>`p:${e.id}`)])}},[_e]);const nn="products"===q.place,ln="trash"===q.place,an="files"===q.place,rn=an?q.folderId:null,tn=nn&&q.nodeId?He.get(q.nodeId)?.path[0]:void 0,on=e=>e?.sharedFrom?`${Me.readOnly} ${Me.editedAtHq(e.sharedFrom)}`:Me.readOnly,dn=L(()=>re.map(e=>e.id),[re]),sn=L(()=>new Map(re.map(e=>[e.id,e])),[re]),cn=s(dn),un=L(()=>dn.filter(e=>cn.selected.has(e)),[dn,cn.selected]),mn=1===un.length?sn.get(un[0]):void 0,pn=A(!0);U(()=>{pn.current?pn.current=!1:cn.clear()},[_e]);const hn=me?.join("\0");U(()=>{me&&cn.setSelection(me)},[hn]);const fn=A(hn??""),gn=un.join("\0");U(()=>{fn.current!==gn&&(fn.current=gn,pe?.(un))},[gn]);const vn=(e,n={})=>{Ue?cn.select(e):cn.select(e,{ctrl:!(!n.ctrlKey&&!n.metaKey),shift:!!n.shiftKey})},[yn,kn]=R(null),bn=e=>{const n=yn;if(kn(null),!n||null==e)return;e!==("folder"===n.kind?Je.get(n.id)?.name:sn.get(n.id)?.name)&&xe?.(n,e)},wn=async e=>{if(!we)return;const n=await we(e);qe(["@files",...e?[e]:[]]),"string"==typeof n&&kn({kind:"folder",id:n})},xn=M(e=>{const n=[],l=n=>{if("files"===e.kind)return n===rn&&an?Me.alreadyHere:void 0;const l=Je.get(e.id);return n===e.id||n&&$e(n,e.id)?Me.notIntoItself:(l?.parentId??null)===n?Me.folderAlreadyHere:void 0};n.push({key:u,label:Me.allFiles,disabledReason:l(null)});const a=(e,r)=>{for(const i of Ze.get(e)??[])n.push({key:i.id,label:i.name,depth:r,disabledReason:l(i.id)}),a(i.id,r+1)};return a(null,1),n},[Ze,Je,an,$e,rn,Me]),Nn=M(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:Me,media:Re,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),kn(e)}:void 0,move:Ne&&Ke?Ne:void 0,trash:Ce&&Ke?Ce:void 0,deleteFolder:Ie&&Ke?Ie:void 0,folderNotEmpty:e=>!!Je.get(e)?.notEmpty,replace:ze&&Ke?ze:void 0,copyUrl:e=>{const n=sn.get(e)?.url;n&&h(Me.urlLabel,n)},openInDesign:Fe,restore:De,deleteForever:Se},Sn=e=>m(e,Dn),jn=w(),zn=(e,n)=>{Ue||(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)))},[Tn,Fn]=R(null),[On,En]=R(null),[Pn,An]=R(null);U(()=>{if(!On&&!Tn)return;const e=()=>{En(null),Fn(null)};return window.addEventListener("dragend",e),window.addEventListener("drop",e),()=>{window.removeEventListener("dragend",e),window.removeEventListener("drop",e)}},[On,Tn]);const Ln=(e,n)=>Array.from(e.dataTransfer?.types??[]).includes(n),Mn=(e,n)=>!(!Ne||fe.move||Ue)&&(!!Ln(e,W)||!(!Ln(e,H)||!Pn)&&(n!==Pn&&!(n&&$e(n,Pn)))),Rn=(e,n)=>({onDragEnter:l=>{Mn(l,n)&&(l.preventDefault(),Fn(e))},onDragOver:l=>{Mn(l,n)&&(l.preventDefault(),l.dataTransfer.dropEffect="move",Tn!==e&&Fn(e))},onDragLeave:n=>{const l=n.relatedTarget;l&&n.currentTarget.contains(l)||Fn(n=>n===e?null:n)},onDrop:e=>{if(Mn(e,n))if(e.preventDefault(),Fn(null),Ln(e,W)){let l;try{l=JSON.parse(e.dataTransfer.getData(W))}catch{l=null}Array.isArray(l)&&l.length&&Ne({kind:"files",ids:l.map(String)},n)}else Pn&&(Ne({kind:"folder",id:Pn},n),An(null))}}),Un=e=>{const n=e=>Ln(e,W)||Ln(e,H)||Ln(e,"Files");return{onDragEnter:l=>{n(l)&&En(e)},onDragOver:l=>{n(l)&&On!==e&&En(e)},onDragLeave:n=>{const l=n.relatedTarget;l&&n.currentTarget.contains(l)||En(n=>n===e?null:n)}}},Kn=(e,n,l)=>/* @__PURE__ */G(O,{side:"right",content:On===e?Me.noDropProducts:on(l),open:On===e||!On&&void 0,children:/* @__PURE__ */G("span",{children:n})}),Bn=e=>({onContextMenu:n=>{jn.open(n,e)}}),Gn=(e,a,r)=>e.map(e=>{const i=`p:${e.id}`,t=r??e,o=Xe.has(i),d=e.children?.length?e.children:null;/* @__PURE__ */
|
|
3
|
-
return K("div",{role:"none",className:"contents",children:[
|
|
4
|
-
/* @__PURE__ */G(n,{label:Kn(i,e.name,t),level:a,icon:d&&o?$.folderOpen:$.folder,badge:null!=e.count?e.count:void 0,selected:nn&&q.nodeId===e.id,expanded:d?o:void 0,onToggle:d?()=>Qe(i):void 0,onSelect:()=>_({place:"products",nodeId:e.id}),rowProps:{"data-media-row":i,...Un(i),...Ke?Bn({kind:"product-node",id:e.id}):{}}}),d&&o&&/* @__PURE__ */G(l,{children:Gn(d,a+1,t)})]},e.id)}),Wn=(e,a)=>(Ze.get(e)??[]).map(e=>{const r=Ze.get(e.id),i=Xe.has(e.id),t="folder"===yn?.kind&&yn.id===e.id,o=Sn({kind:"folder",id:e.id});/* @__PURE__ */
|
|
5
|
-
return K("div",{role:"none",className:"contents",children:[
|
|
6
|
-
/* @__PURE__ */G(n,{label:e.name,level:a,icon:r&&i?$.folderOpen:$.folder,badge:null!=e.count?e.count:void 0,selected:t||an&&q.folderId===e.id,expanded:r?i:void 0,onToggle:r?()=>Qe(e.id):void 0,onSelect:()=>_({place:"files",folderId:e.id}),drop:Tn===e.id?"into":void 0,dragging:Pn===e.id,draggable:Ke&&!!Ne&&!fe.move,rename:t?/* @__PURE__ */G(Y,{value:e.name,label:Me.folderName,onDone:bn}):void 0,actions:Ke&&o.length?/* @__PURE__ */G(f,{align:"end","aria-label":Me.folderActions,trigger:$.more,items:o}):void 0,rowProps:{"data-media-row":e.id,...Rn(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(H,e.id),An(e.id)},onDragEnd:()=>{An(null),Fn(null)}}:{}}}),r&&i&&/* @__PURE__ */G(l,{children:Wn(e.id,a+1)})]},e.id)}),Hn=Xe.has("@files"),Jn=Xe.has("@products"),Zn=/* @__PURE__ */K(e,{"aria-label":Me.folders,children:[ne&&/* @__PURE__ */K(B,{children:[
|
|
7
|
-
/* @__PURE__ */G(n,{label:Kn("@products",Me.products),level:1,icon:$.lock,badge:{label:Me.readOnlyBadge,tone:"neutral"},expanded:ne.length?Jn:void 0,onToggle:()=>Qe("@products"),selected:nn&&null==q.nodeId,onSelect:()=>_({place:"products",nodeId:null}),rowProps:{"data-media-row":"@products",...Un("@products")}}),Jn&&ne.length>0&&/* @__PURE__ */G(l,{children:Gn(ne,2)})]}),
|
|
8
|
-
/* @__PURE__ */G(n,{label:Me.allFiles,level:1,icon:Hn?$.folderOpen:$.folder,badge:null!=le?le:void 0,expanded:Ze.get(null)?.length?Hn:void 0,onToggle:()=>Qe("@files"),selected:an&&null==q.folderId,onSelect:()=>_({place:"files",folderId:null}),drop:"@files"===Tn?"into":void 0,rowProps:{"data-media-row":"@files",...Rn("@files",null)}}),Hn&&(Ze.get(null)?.length??0)>0&&/* @__PURE__ */G(l,{children:Wn(null,2)}),Ke&&/* @__PURE__ */G(n,{label:Me.trash,level:1,icon:$.trash,badge:null!=ae?ae:void 0,selected:ln,onSelect:()=>_({place:"trash"}),rowProps:{"data-media-row":"@trash"}})]}),Vn=(()=>{if(ln)return[{label:Me.trash}];if(nn){const e=q.nodeId?He.get(q.nodeId)?.path??[]:[];return[{label:Me.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=Ve(rn);return[{label:Me.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}))]})(),$n=nn?Me.readOnly:fe.upload,Xn=!!be&&!ln&&!$n,Yn=D({accept:ge,maxSizeBytes:ve,multiple:!0,disabled:!Xn,onAccept:e=>be?.(e,rn)}),Qn=nn?Me.noProductFolder:fe.newFolder,qn=e=>e?{"aria-disabled":!0,disabledReason:e}:{},_n=/* @__PURE__ */K("div",{className:"flex flex-wrap items-center gap-2",children:[Ke&&we&&!ln&&/* @__PURE__ */G(z,{variant:"secondary",size:"sm",leftIcon:$.folderPlus,onClick:()=>{wn(rn)},...qn(Qn),children:Me.newFolder}),be&&!ln&&/* @__PURE__ */G(z,{variant:"primary",size:"sm",leftIcon:$.upload,onClick:()=>Yn.open(),...qn($n),children:Me.upload}),Ke&&ln&&je&&re.length>0&&/* @__PURE__ */G(z,{variant:"danger",size:"sm",onClick:je,...qn(fe.deleteForever),children:Me.emptyTrash})]}),el=(e,n,l,a,r)=>/* @__PURE__ */G("div",{style:{width:We?void 0:r,flex:We?"1 1 120px":"0 0 auto",minWidth:0},children:/* @__PURE__ */G(g,{size:"sm","aria-label":e,value:n,onChange:a,options:l})},e),nl=e=>n=>de?.({...oe,[e]:n}),ll=/* @__PURE__ */K("div",{className:"flex flex-wrap items-center gap-2",children:[te&&/* @__PURE__ */G("div",{style:{flex:"1 1 200px",minWidth:0},children:/* @__PURE__ */G(C,{size:"sm",type:"search",leftIcon:$.search,placeholder:nn?Me.searchProducts:Me.search,"aria-label":nn?Me.searchProducts:Me.search,value:ie??"",onChange:e=>te(e.target.value)})}),de&&el(Me.mediaType,oe.type,[{value:"all",label:Me.allTypes},{value:"image",label:Me.images},{value:"video",label:Me.videos},{value:"svg",label:"SVG"},{value:"gif",label:"GIF"}],nl("type"),130),de&&!nn&&!ln&&el(Me.use,oe.use,[{value:"any",label:Me.anyUse},{value:"email",label:Me.emailOnly},{value:"website",label:Me.websiteOnly},{value:"unused",label:Me.notUsed}],nl("use"),130),de&&Ke&&el(Me.sort,oe.sort,[{value:"newest",label:Me.newest},{value:"name",label:Me.byName},{value:"size",label:Me.bySize}],nl("sort"),110),se?.map(e=>el(e.label,e.value,e.options,e.onChange,120)),ue&&/* @__PURE__ */G(k,{size:"sm",label:Me.view,value:ce,onChange:ue,options:[{value:"grid",label:Me.grid,icon:$.grid},{value:"list",label:Me.list,icon:$.list}]})]}),al=e=>{const n=[];return null!=e.trashedDaysAgo&&n.push({key:"t",label:Me.daysAgo(e.trashedDaysAgo),count:e.trashedDaysAgo,icon:X.clock,tone:"neutral"}),e.usedCount&&n.push({key:"u",label:Me.used(e.usedCount),count:e.usedCount,icon:X.link,tone:"active"}),e.email&&n.push({key:"e",label:Me.email,icon:X.email,tone:"queued"}),e.private&&n.push({key:"p",label:Me.private,icon:X.lock,tone:"neutral"}),n},rl=e=>al(e).map(e=>/* @__PURE__ */G(j,{tone:e.tone,size:"xs",children:e.label},e.key)),il=Ke&&an&&!!Ne&&!fe.move,tl=!!Ae&&!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=re.map(e=>({id:e.id,url:e.thumbUrl??e.url,name:e.name,kind:e.kind,caption:e.name,badges:al(e),dragData:il?JSON.stringify(cn.isSelected(e.id)?un:[e.id]):ol(e),...il&&ol(e)?{dragAlso:{[J]:ol(e)}}:{}})),sl=We?Math.max(72,Math.floor((Ge-24-16-1)/3)):112,cl=A(null),ul=c({containerRef:cl,enabled:Ke&&!We&&re.length>0,selected:cn.selected,setSelection:e=>cn.setSelection(e),clearSelection:cn.clear}),ml=e=>{if(Ue){const n=sn.get(e);return void(!n||n.private||n.pickDisabledReason||Oe?.(n))}const n=dn.indexOf(e);n>=0&&In(n)},pl=re.length?null:ie?/* @__PURE__ */G(r,{variant:"dashed",title:Me.noMatches}):nn?/* @__PURE__ */G(r,{variant:"dashed",title:Me.emptyProducts,description:on(tn)}):ln?/* @__PURE__ */G(r,{variant:"dashed",title:Me.trashEmpty}):!Xn||Ue?/* @__PURE__ */G(r,{variant:"dashed",title:Me.emptyFolder}):null,hl="list"===ce&&re.length>0,fl=pl??(hl?/* @__PURE__ */G("ul",{role:"listbox","aria-multiselectable":Ke||void 0,"aria-label":Me.folders,className:"flex flex-col gap-1",children:re.map(e=>/* @__PURE__ */K("li",{role:"option","aria-selected":cn.isSelected(e.id),tabIndex:0,"data-grid-item":"","data-grid-id":e.id,onClick:n=>vn(e.id,n),onDoubleClick:()=>ml(e.id),onContextMenu:n=>zn(e.id,n),draggable:!!ol(e)||void 0,onDragStart:ol(e)?n=>{n.dataTransfer.effectAllowed="link",n.dataTransfer.setData(J,ol(e)),Ae("start")}:void 0,onDragEnd:ol(e)?e=>Ae("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-blue-50 text-blue-700":"text-gray-700 hover:bg-gray-100"),children:[
|
|
9
|
-
/* @__PURE__ */G("img",{src:e.thumbUrl??e.url,alt:"",className:"h-10 w-10 shrink-0 rounded bg-gray-100 object-contain"}),
|
|
10
|
-
/* @__PURE__ */G("span",{className:"min-w-0 flex-1 truncate",children:e.name}),
|
|
11
|
-
/* @__PURE__ */G("span",{className:"flex shrink-0 items-center gap-1",children:rl(e)}),e.sizeLabel&&/* @__PURE__ */G("span",{className:"w-16 shrink-0 text-right text-xs text-gray-500",children:e.sizeLabel})]},e.id))}):/* @__PURE__ */G(v,{items:dl,readOnly:!Xn||Ue,onFiles:Xn&&!Ue?e=>be(e,rn):void 0,accept:ge,maxSizeBytes:ve,busy:ye,progress:ke,fit:"contain",thumbSize:sl,dragType:il?W:tl?J:void 0,onDragOutChange:tl?e=>Ae(e):void 0,selected:cn.selected,onItemClick:vn,onItemDoubleClick:ml,onItemContextMenu:Ke?zn:void 0,menuOnMedia:Ke})),gl=p({count:un.length,kind:Nn(un),targets:xn({kind:"files",ids:un}),onPick:e=>Ne?.({kind:"files",ids:un},e.key===u?null:e.key)}),vl=T({variant:"secondary",size:"sm"}),yl=/* @__PURE__ */G(f,{align:"start",triggerClassName:vl,trigger:/* @__PURE__ */K(B,{children:[$.folder,Me.moveTo]}),items:gl,disabled:!!fe.move}),kl=Ke&&un.length>1&&!nn?/* @__PURE__ */K("div",{"data-media-bulk":"",className:"flex flex-wrap items-center gap-2 rounded-lg border border-gray-200 px-3 py-2",children:[
|
|
12
|
-
/* @__PURE__ */G(b,{checked:un.length===re.length,indeterminate:un.length<re.length,onChange:e=>e?cn.selectAll():cn.clear(),label:Me.selected(un.length)}),/* @__PURE__ */K(B,ln?{children:[De&&/* @__PURE__ */G(z,{variant:"secondary",size:"sm",leftIcon:$.undo,onClick:()=>De(un),...qn(fe.restore),children:Me.restore}),Se&&/* @__PURE__ */G(z,{variant:"secondary-danger",size:"sm",onClick:()=>Se(un),...qn(fe.deleteForever),children:Me.deleteForever})]}:{children:[Ne&&yl,xe&&/* @__PURE__ */G(z,{variant:"secondary",size:"sm",leftIcon:$.edit,disabled:!0,children:Me.rename}),Ce&&/* @__PURE__ */G(z,{variant:"secondary",size:"sm",leftIcon:$.trash,onClick:()=>Ce({kind:"files",ids:un}),...qn(fe.trash),children:Me.moveFilesToTrash(un.length)})]}),
|
|
13
|
-
/* @__PURE__ */G(z,{variant:"ghost",size:"sm",onClick:cn.clear,children:Me.clearSelection})]}):null,bl=e=>{const n=[],l=(e,l,a)=>{null!=a&&""!==a&&n.push({key:e,label:l,value:a})},a="file"===yn?.kind&&yn.id===e.id;l("name",Me.name,a?/* @__PURE__ */G(Y,{value:e.name,label:Me.fileName,onDone:bn}):e.name),l("type",Me.type,e.typeLabel),l("size",Me.size,e.sizeLabel),l("resolution",Me.resolution,e.resolution),nn?(l("design",Me.design,e.design),l("finish",Me.finish,e.finish),l("angle",Me.angleLug,e.angleLug),l("owner",Me.owner,e.owner)):(l("added",Me.addedBy,e.addedBy),l("folder",Me.folder,e.folderPath)),l("used",Me.usedIn,null!=e.usedCount?Me.places(e.usedCount):void 0);const r=m({kind:"files",ids:[e.id]},Dn).find(e=>"submenu"===e.type);/* @__PURE__ */
|
|
14
|
-
return K("div",{"data-media-details":"",className:"flex flex-col gap-3",children:[
|
|
15
|
-
/* @__PURE__ */G("img",{src:e.url,alt:e.name,className:"aspect-square w-full rounded-lg bg-gray-100 object-contain"}),nn&&/* @__PURE__ */G(N,{tone:"neutral",title:Me.readOnlyBadge,children:on(tn)}),
|
|
16
|
-
/* @__PURE__ */G(t,{size:"sm",columns:1,items:n}),!ln&&/* @__PURE__ */K("div",{className:"flex gap-2",children:[
|
|
17
|
-
/* @__PURE__ */G("div",{style:{flex:"1 1 0",minWidth:0},children:/* @__PURE__ */G(C,{size:"sm",readOnly:!0,value:e.url,"aria-label":Me.fileUrl,onFocus:e=>e.currentTarget.select()})}),
|
|
18
|
-
/* @__PURE__ */G(z,{variant:"secondary",size:"sm",leftIcon:$.copy,onClick:()=>Dn.copyUrl(e.id),children:Me.copyUrl})]}),an&&Ke&&/* @__PURE__ */K("div",{className:"flex flex-wrap gap-2",children:[ze&&/* @__PURE__ */G(z,{variant:"secondary",size:"sm",leftIcon:$.swap,onClick:()=>ze(e.id),...qn(fe.replace),children:Me.replace}),Te&&/* @__PURE__ */G(z,{variant:"secondary",size:"sm",leftIcon:$.crop,onClick:()=>Te(e.id),children:Me.cropEdit}),Ne&&"submenu"===r?.type&&/* @__PURE__ */G(f,{align:"start",triggerClassName:vl,trigger:/* @__PURE__ */K(B,{children:[$.folder,Me.moveTo]}),items:r.items,disabled:!!fe.move}),xe&&/* @__PURE__ */G(z,{variant:"secondary",size:"sm",leftIcon:$.edit,onClick:()=>kn({kind:"file",id:e.id}),...qn(fe.rename),children:Me.rename}),Ce&&/* @__PURE__ */G(I,{"aria-label":Me.moveToTrash,size:"sm",onClick:()=>Ce({kind:"files",ids:[e.id]}),disabledReason:fe.trash,"aria-disabled":!!fe.trash||void 0,children:$.trash})]}),ln&&Ke&&/* @__PURE__ */K("div",{className:"flex flex-wrap gap-2",children:[De&&/* @__PURE__ */G(z,{variant:"primary",size:"sm",leftIcon:$.undo,onClick:()=>De([e.id]),...qn(fe.restore),children:Me.restore}),Se&&/* @__PURE__ */G(z,{variant:"danger",size:"sm",onClick:()=>Se([e.id]),...qn(fe.deleteForever),children:Me.deleteForever})]}),nn&&Fe&&/* @__PURE__ */G(z,{variant:"secondary",size:"sm",leftIcon:$.external,onClick:()=>Fe({kind:"render",id:e.id}),children:Me.openInDesign}),he&&/* @__PURE__ */G(y,{items:he})]})},wl=mn?mn.private?Me.privateNoPick:mn.pickDisabledReason:void 0,xl=Ue?/* @__PURE__ */K("div",{"data-media-picker-footer":"",className:"flex flex-wrap items-center justify-between gap-2 border-t border-gray-200 px-3 py-2",children:[
|
|
19
|
-
/* @__PURE__ */G("span",{className:"min-w-0 truncate text-sm text-gray-500",children:mn?Me.oneChosen(mn.name):Me.noneChosen}),
|
|
20
|
-
/* @__PURE__ */K("div",{className:"flex gap-2",children:[Ee&&/* @__PURE__ */G(z,{variant:"secondary",size:"sm",onClick:Ee,children:Me.cancel}),
|
|
21
|
-
/* @__PURE__ */G(z,{variant:"primary",size:"sm",disabled:!mn,...qn(wl),onClick:()=>{mn&&!wl&&Oe?.(mn)},children:Me.chooseImage})]})]}):null,Nl=Ke&&!!mn,Cl=/* @__PURE__ */K("div",{className:"flex min-w-0 flex-col gap-3",children:[Pe&&/* @__PURE__ */G(N,{tone:"neutral",children:Pe}),
|
|
22
|
-
/* @__PURE__ */K("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[
|
|
23
|
-
/* @__PURE__ */G(d,{items:Vn}),_n]}),ll,kl,
|
|
24
|
-
/* @__PURE__ */K("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,
|
|
25
|
-
/* @__PURE__ */G(a,{rect:ul.rect})]}),Xn&&/* @__PURE__ */G("input",{...Yn.inputProps}),
|
|
26
|
-
/* @__PURE__ */G(S,{rejections:Yn.rejections})]});/* @__PURE__ */
|
|
27
|
-
return K("div",{ref:Be,"data-media-library":"","data-layout":We?"phone":"wide",className:`flex h-full min-h-0 min-w-0 flex-col ${Le}`.trim(),children:[/* @__PURE__ */K("div",We?{className:"flex flex-col gap-3 p-3",children:[Zn,Cl]}:{className:"flex min-h-0 min-w-0 flex-1",children:[
|
|
28
|
-
/* @__PURE__ */G("div",{className:"shrink-0 overflow-y-auto border-r border-gray-200 p-3",style:{width:280,"--rosh-tree-ground":"var(--surface)"},children:Zn}),
|
|
29
|
-
/* @__PURE__ */G("div",{className:"min-w-0 flex-1 overflow-y-auto p-3",children:Cl}),Nl&&/* @__PURE__ */G("div",{className:"shrink-0 overflow-y-auto border-l border-gray-200 p-3",style:{width:300},children:bl(mn)})]}),xl,We&&/* @__PURE__ */G(o,{open:Nl,onClose:cn.clear,side:"bottom",title:mn?.name,children:mn&&bl(mn)}),jn.state&&/* @__PURE__ */G(x,{...jn.props,items:Sn(jn.state.data)}),null!=Cn&&re.length>0&&/* @__PURE__ */G(i,{images:re.map(e=>({url:e.url,caption:e.name})),startIndex:Math.min(Cn,re.length-1),onClose:()=>In(null)})]})}export{W as MEDIA_FILES_DRAG_TYPE,J as MEDIA_FILE_DRAG_TYPE,H as MEDIA_FOLDER_DRAG_TYPE,Q as MediaLibrary,Z as readMediaFileDrag};
|
package/dist/chunk-TIQKDAON.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import{LIGHTBOX_PICTURE_FIT as e,ZoomableImage as t}from"./chunk-CGUMJZUB.js";import{isVideoUrl as r,mediaFileName as n}from"./chunk-4Y4PWKMM.js";import{dialogA11y as o}from"./chunk-VWGWZY7A.js";import{useDismissPopupsOnOpen as i}from"./chunk-PKXQDCNR.js";import{useFocusTrap as l,useScrollLock as a}from"./chunk-CDAJKLGL.js";import{Button_default as s}from"./chunk-4IU5BSVE.js";import{buttonClasses as c}from"./chunk-K7U4RWXJ.js";import{Icon as m}from"./chunk-FSPFV4MI.js";import{Z_LAYERS as d}from"./chunk-62LW225J.js";import{useHydrated as u}from"./chunk-D65T4H6J.js";import{registerModalEscapeInterceptor as h}from"./chunk-TWVUQUUD.js";import{useShellStrings as f}from"./chunk-E6UCGCOC.js";import{useRef as p,useState as x,useCallback as b,useEffect as g}from"react";import{createPortal as k}from"react-dom";import{jsx as w,jsxs as v,Fragment as y}from"react/jsx-runtime";var N=/\.(pdf|docx?|xlsx?|pptx?|csv|txt|zip|rar|7z|dwg|dxf|stp|step|igs|iges)(?:[?#]|$)/i;function C(e){return e.kind?e.kind:r(e.url)?"video":N.test(e.url)?"file":"image"}var j="flex items-center justify-center rounded-full bg-black/60 text-white hover:bg-black/80 rosh-focus-ring focus-visible:ring-2 focus-visible:ring-[color:var(--rosh-focus-ring-solid)]",U=e=>e.stopPropagation();function I({images:r,startIndex:N=0,onClose:I,onIndexChange:L,onOpenFile:W}){const $=f().lightbox,z=u(),A=p(null),D=p(null),[F,J]=x(N),M=r.length,E=z&&M>0,G=b(e=>{if(M<2)return;const t=((F+e)%M+M)%M;J(t),L?.(t)},[F,M,L]);if(i(E),l(A,E,D),a(E),g(()=>{if(E)return h(()=>(I(),!0),()=>A.current)},[E,I]),g(()=>{if(!E)return;const e=e=>{"ArrowLeft"!==e.key&&"ArrowRight"!==e.key||e.target?.closest?.("video")||(e.preventDefault(),G("ArrowRight"===e.key?1:-1))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[E,G]),!E)return null;const K=r[Math.min(F,M-1)],P=C(K),R=K.caption||n(K.url);let V;return V="video"===P?/* @__PURE__ */w("video",{src:K.url,controls:!0,playsInline:!0,"aria-label":R,onClick:U,className:`${e} rounded-lg bg-black`}):"file"===P?/* @__PURE__ */v("div",{onClick:U,className:"flex max-w-[calc(100vw-144px)] flex-col items-center gap-3 rounded-lg bg-white px-10 py-8 text-center text-gray-500",children:[
|
|
2
|
-
/* @__PURE__ */w(m,{name:"document","aria-hidden":"true",className:"h-10 w-10"}),
|
|
3
|
-
/* @__PURE__ */w("span",{className:"max-w-[60ch] break-all text-sm font-medium text-gray-700",children:R}),W?/* @__PURE__ */w(s,{size:"sm",onClick:()=>W(K),children:$.openFile}):/* @__PURE__ */w("a",{href:K.url,target:"_blank",rel:"noopener noreferrer",className:c({size:"sm"}),children:$.openFile})]}):/* @__PURE__ */w(t,{src:K.url,alt:R,className:`${e} object-contain`,frameClassName:"rounded-lg"}),k(
|
|
4
|
-
/* @__PURE__ */v("div",{ref:A,...o({role:"dialog",modal:!0,label:$.label}),"data-lightbox-backdrop":"",className:"fixed inset-0 flex items-center justify-center bg-black/80",style:{zIndex:d.overlay},onClick:I,children:[V,
|
|
5
|
-
/* @__PURE__ */v("div",{className:"absolute right-4 top-4 flex items-center gap-2",onClick:U,children:[
|
|
6
|
-
/* @__PURE__ */w("span",{className:"rounded bg-black/60 px-2 py-1 text-xs text-white tabular-nums",children:$.counter(F+1,M)}),
|
|
7
|
-
/* @__PURE__ */w("button",{ref:D,type:"button",onClick:I,"aria-label":$.close,className:`${j} h-8 w-8`,children:/* @__PURE__ */w(m,{name:"close","aria-hidden":"true",className:"h-4 w-4"})})]}),M>1&&/* @__PURE__ */v(y,{children:[
|
|
8
|
-
/* @__PURE__ */w("button",{type:"button",onClick:e=>{U(e),G(-1)},"aria-label":$.previous,className:`${j} absolute left-4 top-1/2 h-10 w-10 -translate-y-1/2`,children:/* @__PURE__ */w(m,{name:"chevron-left","aria-hidden":"true",className:"h-5 w-5"})}),
|
|
9
|
-
/* @__PURE__ */w("button",{type:"button",onClick:e=>{U(e),G(1)},"aria-label":$.next,className:`${j} absolute right-4 top-1/2 h-10 w-10 -translate-y-1/2`,children:/* @__PURE__ */w(m,{name:"chevron-right","aria-hidden":"true",className:"h-5 w-5"})})]}),
|
|
10
|
-
/* @__PURE__ */v("div",{className:"absolute inset-x-18 bottom-4 flex items-center justify-center gap-3",onClick:U,children:[
|
|
11
|
-
/* @__PURE__ */w("span",{className:"min-w-0 break-words text-center text-sm text-white/85",children:R}),"file"!==P&&/* @__PURE__ */w("a",{href:K.url,target:"_blank",rel:"noopener noreferrer",className:"flex-none text-xs font-medium text-white/70 underline decoration-white/30 underline-offset-2 hover:text-white",children:$.openOriginal})]})]}),document.body)}export{I as ImageLightbox,C as lightboxKind};
|